Migration is the process of recording all the changes of your database. Writing migrations ensures that our database schema also evolves together with our application. It also solves versioning problems. If we have 10 customers and each is running a different version of our application, we don't have to track which schema is installed to which customer. Thanks to the automated process of migrations and migrations being part of the code itself, all we have to do is to run the migrations and it is guaranteed that the database schema will be in the correct state.
Follow these steps to create a migration:
- Add-Migration is Entity Framework command for adding a migration, as shown here:
- Once you add the migration, you can ...