How do I undo the last Add-Migration command?

前端 未结 7 1158
醉酒成梦
醉酒成梦 2020-12-12 13:43

I have created a migration using the Add-Migration command, but I\'d like to change the name of that migration. How can I undo the migration command, so that I

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 13:54

    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/

提交回复
热议问题