Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MahdiKarimipour/4edbae77352cd1cef58791b12d7ce699 to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/4edbae77352cd1cef58791b12d7ce699 to your computer and use it in GitHub Desktop.
Run Entity Framework Migrations using External SQL Files
public partial class FullAddressFullTextIndex : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
string sql = GeneralFunctions.ReadSql(typeof(FullAddressFullTextIndex), "20220702124309_FullAddressFullTextIndex.sql");
migrationBuilder.Sql(sql, true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
string sql = GeneralFunctions.ReadSql(typeof(FullAddressFullTextIndex), "20220702124309_FullAddressFullTextIndexUndo.sql");
migrationBuilder.Sql(sql, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment