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.
Try running:
Update-Database -Script -SourceMigration: <initial-migration> -TargetMigration: <latest-migration>
Obviously replace <initial-migration> and <latest-migration> with the appropriate names of those migrations.
That should generate a script of all migrations at once.
More information can be found here on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With