EF Core - how to re-generate a migration

.net entity-framework-core

Question

When using EF Core I can create a migration using the following command:

Add-Migration Foo

Now I would like to make some changes to the data model and update the Foo migration accordingly. Currently I need to do that in two steps.

Remove-Migration; Add-Migration Foo

Is there any command which will remove and re-add the migration in one step? Something like

Update-Migration Foo

or something equivalent to -Force parameter in EF6?

1
1
9/1/2018 9:41:39 AM

Popular Answer

There is no command for this, And one more thing that you don't remove migration Fooand create it again. Instead of doing this you create a new migration for new changes. because it will be easy for you to track these new changes in the future. you can easily find that you modify these changes in this particular migration.

0
9/1/2018 11:46:44 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow