Updating the database
It’s now time to create a new migration, and reflect the code changes to the database, by taking advantage of the code-first approach we adopted in Chapter 5, Data Model with Entity Framework Core.
Here’s a list of what we’re going to do in this section:
- Add the identity migration using the
dotnet-ef
command, just like we did in Chapter 5, Data Model with Entity Framework Core - Apply the migration to the database, updating it without altering the existing data or performing a drop and recreate
- Seed the data using the
CreateDefaultUsers()
method ofSeedController
that we implemented earlier on
Let’s get to work.
Adding identity migration
The first thing we need to do is to add a new migration to our data model to reflect the changes that we have implemented by extending the ApplicationDbContext
class.
To do that, open a command line or PowerShell prompt, go to our WorldCitiesAPI
project...