I want to update database schema on production database. Usually in my development I just do Add-Migration
and Update-Database
.
My question is how to generate script so I can manually read through the query before executing in production environment? I've tried Update-Database -script
but it gave me No pending explicit migrations
.
答案 0 :(得分:3)
尝试跑步:
Update-Database -Script -SourceMigration: <initial-migration> -TargetMigration: <latest-migration>
显然,请使用相应的迁移名称替换<initial-migration>
和<latest-migration>
。
这应该立即生成所有迁移的脚本。