dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.73k stars 3.17k forks source link

Migrations: A command to upgrade snapshots and backing models #18557

Open bricelam opened 4 years ago

bricelam commented 4 years ago

I don't think our current approach of keeping the model snapshots around forever is sustainable. We should consider adding a command like dotnet ef migrations recreate that reads the models (and possibly the migrations) and re-scaffolds them. This would allow us to eventually remove obsolete model building (and migrations) APIs.

We could even issue a warning during dotnet ef migrations add that they have migrations using obsolete APIs and they need to run the new command before they are removed in a future version.

AndriySvyryd commented 1 year ago

Consider generating a more efficient snapshot representation: https://github.com/dotnet/efcore/issues/20104