Skip to content

feat: drop schema version tracking entirely#74

Merged
effron merged 2 commits into
mainfrom
schema-drop-version-tracking
Jul 15, 2026
Merged

feat: drop schema version tracking entirely#74
effron merged 2 commits into
mainfrom
schema-drop-version-tracking

Conversation

@effron

@effron effron commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description:

Every new migration rewrites the schema's schema_version line, so any two branches that add migrations conflict on it. Rather than making that line cleverer, this deletes it: the CLI stops writing schema_version, and schema load marks every migration on disk as applied instead of comparing against the schema's recorded high-water mark. That's safe because the CLI always writes a migration file and its schema change together, so the schema body already reflects everything in testtrack/migrate.

The tradeoff: if someone hand-copies a migration file into testtrack/migrate without its schema change, schema load used to print a warning and leave that migration for testtrack migrate to apply against the new server; now it gets marked applied with no diagnostic. That only bites when a migration bypassed testtrack create and only on freshly bootstrapped servers.

Testing Done:

Ran the new binary against a fresh retail worktree: create feature_gate works directly on the existing schema (the diff is just the dropped schema_version line plus the new split), a 1.9 binary interleaved with the new one round-trips the schema with no errors, and schema load against a stub server marked exactly the 3,366 unique migration versions on disk as applied. Retail's test_track meta specs pass unchanged.

Comparison-only variant answering: what if v2 is deleting the record
instead of reshaping it? The schema file becomes body-only. schema load
marks every migration on disk as applied when bootstrapping a server,
trusting that the body reflects disk (the CLI always writes them together).

Gains: the merge-conflict hotspot is deleted rather than scattered; no
format break (1.x reads a scalar-less schema fine, so no flag day, no
guards, no schema upgrade command); the first 2.0 write drops the scalar
organically.

Gives up: the load-time unrecorded-migrations warning (body/disk drift
becomes undetectable) and the bootstrap self-heal (a pending migration is
stamped applied on fresh servers instead of being left for migrate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@effron effron force-pushed the schema-drop-version-tracking branch from 7c87eeb to 51055a0 Compare July 15, 2026 15:22
@effron effron marked this pull request as ready for review July 15, 2026 15:25
schema.yml loses the schema_version field and schema load marks all disk
migrations applied instead of skipping unrecorded ones, but old and new
binaries interoperate with no coordination, so this ships as a minor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@effron effron force-pushed the schema-drop-version-tracking branch from 0b3b1f4 to 049c158 Compare July 15, 2026 15:31
@effron effron changed the title comparison: drop schema version tracking entirely feat: drop schema version tracking entirely Jul 15, 2026
@effron effron requested review from samandmoore and smudge July 15, 2026 16:37
@effron effron merged commit a8db5ff into main Jul 15, 2026
5 checks passed
@effron effron deleted the schema-drop-version-tracking branch July 15, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants