You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a project using EF Core 7, which involves around 300 tables and over 200 migrations. Each migration's Designer file is exceptionally large, leading to extended project compilation times. I am seeking advice on how to address and optimize this issue.
The text was updated successfully, but these errors were encountered:
@haoyk the Designer file being exceptionally large points to you possibly including large seeding data or similar, which is highly discouraged (see seeding docs).
@haoyk the Designer file being exceptionally large points to you possibly including large seeding data or similar, which is highly discouraged (see seeding docs).
Hi Roji, even without seeding any data, designer files get huge quickly in large applications. For instance, there are 500+ tables in my current project, and every designer file is 30k+ lines (~1MB). This leads to over 2 minutes of build time (instead of a few seconds without the designer files).
For now, I've added a condition to unload all designer files from the project in debug mode, and only load the last few ones when actively creating new migrations. A proper official fix would be welcome though.
For now, the only solution we can propose is to periodically squash your migrations, i.e. begin over - that makes sense when you know that all production servers are aligned on the latest migration, and keeping the history has very little value - see the docs for that. #2174 tracks a more first-class experience for that.
I am developing a project using EF Core 7, which involves around 300 tables and over 200 migrations. Each migration's Designer file is exceptionally large, leading to extended project compilation times. I am seeking advice on how to address and optimize this issue.
The text was updated successfully, but these errors were encountered: