Applying the migration

The next thing to do is to apply the new migration to our Database and update the existing data accordingly. Since we updated our DbSeeder class to support the new changes, the best thing we can do is to let it repopulate our database accordingly. Unfortunately, we know perfectly well that as long as there are some existing users in the database tables, the CreateUsers() method won't even run. This leaves us with two options:

  • Upgrade the existing database, then manually delete all users; if we do that, the DbSeeder will recreate them all on the first run using the ASP.NET Core Identity interface
  • Drop and recreate the database entirely, so the DbSeeder will kick in and repopulate everything--users, quizzes, questions, and so on--on the first run
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.18.141