Every time your model changes, you need to add a new migration to your project. Follow these steps to learn how to do this::
- Open the Package Manager Console (Tools | NuGet Package Manager | Package Manager Console).
- Type and run the following command:
Add-Migration [Migration Name] -p [Project Name]
- The initial migration in the GiveNTake application was created as follows:
Add-Migration InitialMigration -p GiveNTake
After the command is complete, a new file will be added to your project under a folder with the name Migrations. The file is named in the [Creation Time]_[Migration Name] format, for example, 20180219101736_InitialMigration.cs.
This file contains a class that derives from Microsoft.EntityFrameworkCore.Migrations.Migration ...