EF Migration migrate to 0 call initial creates dow

2019-07-21 14:44发布

问题:

I'm trying to figure out the syntax to bring migrations down to an empty database as in call the down method on the inital create migration. Does anyone know the proper syntax to call the Down method in a migration something akin to this:

Update-Database -StartupProjectName "Infrastructure.Data" -TargetMigration 0

回答1:

update-database -startupproject someproject -targetmigration 0

That will bring you back to a completely empty database.

I assembled a complete reference to the package manager commands for ef migrations.