如何从SQL Server 2016生产计算机还原EF Core迁移

时间:2018-02-08 09:58:18

标签: sql-server entity-framework-core ef-core-2.0

我必须从没有安装Visual Studio的SQL Server 2016中恢复最后一次EF Core迁移。怎么做?

注意:我已经尝试在服务器上安装.NET SDK,但它不知道命令dotnet ef。执行命令会导致 No executable found matching command "dotnet-ef"

1 个答案:

答案 0 :(得分:3)

您可以使用Script-Migrationdotnet ef migrations script命令生成SQL脚本以还原迁移。

dotnet ef migrations script TheAppliedMigration TheMigrationBeforeIt -o revert.sql