How do I undo the last Add-Migration command?
If you haven't used Update-Database
you can just delete the migration file. If you've run the update you should roll it back using Update-Database -TargetMigration "NameOfPreviousMigration"
then delete the migration file.
Reference:
http://elegantcode.com/2012/04/12/entity-framework-migrations-tips/
If you haven't executed the migration yet with Update-Database
, you can run Add-Migration
again with the same name (you may need to use -Force
) to re-execute the scaffolding. This is noted in the output of the Add-Migration
command.