Code first migrations - how to rollback first migration

341 Views Asked by At

Using code first migrations it is trivial to migrate to any given migration by using -TargetMigration [MigrationName].

But how do you rollback to before the first migration? What migration do you target for that? The first migration has a Down() just like the rest and the logic is sound - but how do I get it to execute via a update-database command?

1

There are 1 best solutions below

0
On BEST ANSWER

Use this command:

Update-Database -Target 0