Restore database first in Entity Framework code

I did in my model and updated database using

Add-Migration sdfgfsd Update-Database 

Now I found the change I just made is not necessary.

I would like to return the code and the database.

How can i do this?

+5
source share
1 answer

Yes - it's that simple. Use

 Update-Database -TargetMigration:zzzz 

Where zzzz is the name of the migration to the one you want to undo.

EDIT Then you need to remove the migration after zzzz.

If you want to roll back all migrations or if you have only one migration, use

 update-database -target:0 
+8
source

All Articles