dotnet / dotnet/EntityFramework.Docs
Overview article is missing key workflow concepts
- Dominant language
- Mermaid
- Stars
- 1.7k
- Forks
- 2k
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 16
Description
This overview article is missing some key concepts that are essential to reasoning about and understanding migrations. Here is roughly what I believe is missing. The goal is to provide just enough of a framework so the reader can see where the subsequent details fit into the overall workflow:
**Migrations Workflow Key Concepts:**
Once the model has been changed in your code, you will run command line EF Core Tools to generate the migration. This only produces C# code in your project which should be under source control with your project. It does not yet change your database. Next, the EF Core Tools commands can be used to actually update the database. It will (behind the scenes) use the migration to generate the SQL scripts needed to make the schema changes, and then run those scripts. That is appropriate for development situations and very simple production scenarios. In other cases you may want to just generate and save those migration scripts as SQL files. There are EF Core Tools commands to do that as well.
To keep track of the history of migrations applied, EF Core Tools will create and use a history table in your database. The combination of the current database schema, the history table, and the in-project C# migration files is important to keeping your migrations working smoothly. Typically none of those should be changed manually. You will update you model, and use the EF Core tools to propagate those changes to the schema, history, and migrations.
---
#### Document Details
⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*
* ID: 6e28b0a8-b7e4-4c07-9e60-0df403bbee28
* Version Independent ID: 12300b31-6f7b-b75c-970d-693365e77013
* Content: [Migrations Overview - EF Core](https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli)
* Content Source: [entity-framework/core/managing-schemas/migrations/index.md](https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/managing-schemas/migrations/index.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @bricelam
* Microsoft Alias: **avickers**
Contributor guide
Assessment
This issue has not been assessed yet.