Can I dry run Update-Database in EF 6?

I am wondering if there is a way to run Update-Database

from the package manager console with something similar to a Rails flag --dry-run

to see what will run before executing it. My googling did not lead to an appropriate command for EF.

Is he there? Is there a hack for essentially the same thing?

+3


source to share


1 answer


You can use Update-Database

with flag -Script

to generate SQL script instead of applying migration. If you do not specify a migration source, it will use the current state of the database as a starting point, so you can use the file to check what would be done on the database.



https://msdn.microsoft.com/en-us/data/jj591621.aspx#script

+5


source







All Articles