How do I undo the last Add-Migration command?

前端 未结 7 1169
醉酒成梦
醉酒成梦 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:52

    With EntityFrameworkCore 2.0 comes the model snapshot. You will need to run the remove migration command in order to update the model snapshot. I have read that EF Core will recognize any update and revert the snapshot for you if you manually delete the migration but this has not worked for me.

    https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations

    https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#dotnet-ef-migrations-remove

提交回复
热议问题