Your six questions, answered on alcohol.zinc
Keep the snapshot, still one DbContext, one migration gap to close in CI, and Bun has one plug-in system.
Yes, while we use EF migrations; keep it and add one guide line
The short answer comes first, as a card:
It is one file per app, written by EF, never by hand, and in alcohol.zinc's history it never clashed Measured.
The ways to live without it, priced on alcohol.zinc's 15 migrations:
| Way | One-time cost | Cost on every change | Tag |
|---|---|---|---|
| Keep it, re-add a migration on a clash | none | one command, only on a clash | measured |
| Hand-written SQL files (our Bun and Go way) | export 727 lines of SQL, write a runner | every schema change by hand | reasoned |
| Another tool (DbUp, FluentMigrator, Atlas) | as SQL files, plus a dependency | depends on the tool | not tested |
| A git merge driver that rebuilds the snapshot | write it, install it everywhere | a build inside every merge | not tested |
| Keep both sides on a clash (merge=union) | one .gitattributes line | can produce broken code | measured |
Only the first row is cheap and measured. With SQL files, nothing writes the next change for you, and the model and the SQL can drift apart silently; 4 of the 15 migrations already hold hand SQL. Decide thisQ2What do we do about the .NET snapshot?
Yes: still exactly one DbContext, one database, one snapshot
The answer card:
Still one MainDbContext
The shared file goes from 343 lines to 30 and names no module; the snapshot stayed byte-for-byte the same Measured.
You also asked, earlier in the same thread: "dont we just have 1 dbcontext, and everything is registered there? can't we just make that part dynamic?" Yes, and that is what this is: it is done at build time by the compiler, not by searching at run time.
Of three problems you heard about, one is left, and it is small
You heard three different things; this is where each one stands:
| Problem | Status | Why |
|---|---|---|
| One DbContext per module | dropped | it caused 5 problems; one shared DbContext has none |
| The snapshot can clash | stays, small | one file, a one-command fix |
| A forgotten migration goes unnoticed | true today, not caused by wiring | fix: one CI line |
The third one is real in alcohol.zinc today Measured:
- A column was added without a migration. CI's tests passed, 158 of 158, because they build tables from the model.
- The migrator said "Successfully migrated" and the app started. The column did not exist, and a query that used it failed.
- alcohol.zinc is on EF Core 8, which does not check for model changes when it migrates. EF 9 and later refuse instead From docs.
Yes, one plug-in system for run, test, watch and the build API
The answer card:
One plug-in system for both
There is one gap Measured: the bun build command line cannot load a plug-in, and fails with Could not resolve: "virtual:features".
- So the template's release build runs a 20-line
tools/build.ts, which callsBun.build, instead of the command. - The output is the same. Decide thisQ4Is the Bun release-build script acceptable?
Yes: everything in this report is alcohol.zinc, converted whole
The answer card:
The whole app, not a sample
Every number on the earlier pages comes from that run.
That was true only for one DbContext per module, which is dropped
The answer card:
Worse only in the dropped design
alcohol.zinc confirms the second result: same model, same tests, 2 fewer shared files per feature Measured.