Creating a Migration

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:

  1. Add-Migration is Entity Framework command for adding a migration, as shown here:
  1. Once you add the migration, you can ...

Get ASP.NET Core 2 Fundamentals now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.