IW4M-Admin/SharedLibraryCore/Migrations/20190222234742_AddIndexToEFMeta-KeyAndClientId.cs

31 lines
892 B
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore.Migrations;
namespace SharedLibraryCore.Migrations
{
public partial class AddIndexToEFMetaKeyAndClientId : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
2019-02-22 20:35:03 -05:00
if (migrationBuilder.ActiveProvider == "Pomelo.EntityFrameworkCore.MySql")
{
migrationBuilder.Sql("CREATE FULLTEXT INDEX IX_EFMeta_Key ON EFMeta ( `Key` );");
}
else
{
migrationBuilder.CreateIndex(
name: "IX_EFMeta_Key",
table: "EFMeta",
column: "Key");
}
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_EFMeta_Key",
table: "EFMeta");
}
}
}