Closed vitoscalleta closed 4 years ago
Hi, Migrations are set to auto-run everytime you run the application. It's a tested implementation.
About the update-database query that you had mentioned. please check the readme. It's already mentioned on how to handle multiple context files. It would go something like ' update-database -c IdentityContext '
And yes, I am working on a way to manually trigger the Seeding mechanism. But also, it seeds automatically on runtime for others as well when I checked. Can you check your program.cs , place a breakpoint and debug the seed process and let me know?
Thanks ! After following the Readme I am able to get application working. Database is seeded. I believe my Update-Database command for Identity DB Context did not work properly or I missed something there.
Is your feature request related to a problem? Please describe. Need more clarity on how migrations should be applied and database should be seeded. I tired running the solution after changing the Connection String in appsettings.json file in the .Web project. After starting the project I tried to login using the provided credentials in login page. I was taken to a error page saying that Migration was pending with button to Apply Migrations. I clicked on Apply migrations and tried to login again. It was saying no such user.
When I check in Database I found that Users, Roles and many other tables were empty, meaning the database hasn't been seeded with user data.
Describe the solution you'd like Either the user table should be seeded with data by the application itself during initial start or you can provide instructions how users can do that manually.
Describe alternatives you've considered Could there be any migrations still pending ? If so how to Update-Database with those migrations ? When I run Update-Database command it is asking me to specify DbContext name as there are multiple Db Contexts
Additional context NA.