maxfridbe
maxfridbe

Reputation: 5970

EF Migration migrate to 0 call initial creates down

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

Upvotes: 4

Views: 7632

Answers (1)

Anders Abel
Anders Abel

Reputation: 69260

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.

Upvotes: 13

Related Questions