I need to make a "full-text indexed" but I am using ef core 2.1 code first migration, but Full Indexes do not have first class support in core.
How can I write my own migration that would be applied while the other generated migrations are being applied?
You have to create empty migration and then in Up
method you can write your SQL query.
public partial class your_migration_name : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"<YourQuery>");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"Drop <YourQuery>");
}
}
Update-Database
in Package Manager Console.