Generate new migrations based on all models

6

I need to create a migrations with all the created models (I just deleted the first migration and I'm not able to create the authentication database).

    
asked by anonymous 28.09.2018 / 04:17

1 answer

4

If only the migration has been deleted (still with ModelSnapshot and the database still created) :

Delete the ModelSnapshot file and ALL migration-related files (* .Designer.cs and * .resx) (remain in the Migrations folder) and run the Add-Migration with the same name as the previous migration (to ensure that If you are unsure about the migration name, make a select in the "__EFMigrationsHistory" table in the database where this migration has already been run and look at its name , it is useful to change the name of the created migration class so that it is IDENTICAL to the name in this table.)

    
03.10.2018 / 00:43