6
I need to create an Migrations with all the models created (I ended up deleting the first Migration and I am not able to create the authentication database).
6
I need to create an Migrations with all the models created (I ended up deleting the first Migration and I am not able to create the authentication database).
4
If only the migration has been deleted(still with Modelsnapshot and the base still created):
delete the Modelsnapshot and ALL migration-related files (*.Designer.Cs and *.resx)(in the Migrations folder) and run the Add-Migration with the same name as the previous migration(to ensure that, in the database in which the migration has already been run, the system does not attempt to create the whole structure again, if you have doubts about the migration name, select in the "__Efmigrationshistory" table in the bank where this migration has already been run and look at its name, it is useful to change the name of the migration class created so that it is IDENTICAL to the name in this table).
No Modelsnapshot in Migrations folder.
And yet Add-Migration keeps generating empty?
if yes, could clean run a delete in the table "__Efmigrationshistory" (can be of all the same data) and try again?
I have already done these procedures. Continue to generate an empty Migration.
You could open your "Migrations" folder in the explorer and tell me which files are in it?
http://prntscr.com/l1gozb
Let’s go continue this discussion in chat.
Browser other questions tagged asp.net-mvc entity-framework
You are not signed in. Login or sign up in order to post.
If you try to create again using the command
Add-Migration NomeDaMigration
and even then it does not generate, so if you can (check before if you do not have confidential data that cannot be lost for example), one option is to delete the database and then run the commandUpdate-Database
. Done this you try to generate again with the commandAdd-Migration NomeDaMigration
. In case this resolves I insert as answer :-)– Renan
Does not solve. It continues to generate a new Migration, but empty.
– user108720