In this chapter, I will cover how migrations work in Entity Framework Core 5. A migration allows you to version database changes in your application. I will cover how you can add and run migrations. I will also cover how you can update to a given database version or revert to a previous migration.
What Is a Migration?
In prior chapters, I have covered how to add a new migration and how to update your database to the latest migration. A migration is code that alters your database and contains two methods: Up() and Down(). The Up() method will make the necessary changes to your database to update it. ...