Entity Framework – Start Over – Undo/Rollback All Migrations

You can rollback to any migration by using:

Update-Database -TargetMigration:"MigrationName"

If you want to rollback all migrations you can use:

Update-Database -TargetMigration:0

or equivalent:

Update-Database -TargetMigration:$InitialDatabase 

In some cases you can also delete database and all migration classes.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)