Skip to content

migrations: linearize the chain — io_log chains after rating (no fork)#35

Open
hhuuggoo wants to merge 1 commit into
mainfrom
fix-migration-fork
Open

migrations: linearize the chain — io_log chains after rating (no fork)#35
hhuuggoo wants to merge 1 commit into
mainfrom
fix-migration-fork

Conversation

@hhuuggoo

Copy link
Copy Markdown
Contributor

What

The three phoebe Alembic migrations had a fork: rating (c2f1a3b4d5e6) and io_log (c2e1d3f4a5b6) both pinned down_revision = b1f0c2d3e4a5 (billing_event) → two heads, which Alembic rejects and which violates our linear-history rule.

Fix: re-point io_log's down_revision to c2f1a3b4d5e6 (rating). The chain is now a single linear line as-shipped — no manual re-pointing at apply time:

c1d2e3f4a5b6 (current Atlas head) → billing_event → rating → io_log

Verified by graph-walking the three files: exactly one head (io_log), zero forks.

Why now

Surfaced while preparing to apply phoebe's migrations to a live Atlas DB for the Token Factory deploy — the fork would have made alembic upgrade head ambiguous (two heads). The README had documented the linearization as a manual copy-time step that was never baked into the files; this makes the files correct by construction and updates the README to match.

Contracts

No schema change — only the down_revision pointer on io_log and the README. The migrations' DDL is untouched.

The three phoebe Alembic migrations had a FORK: rating (c2f1a3b4d5e6) and io_log
(c2e1d3f4a5b6) BOTH pinned down_revision = b1f0c2d3e4a5 (billing_event), giving
two heads — which Alembic rejects and which violates our linear-history rule.

Fix: re-point io_log's down_revision to c2f1a3b4d5e6 (rating), so the chain is a
single linear line as-shipped:

  c1d2e3f4a5b6 (Atlas head) -> billing_event -> rating -> io_log

No manual re-pointing at apply time anymore. The README previously documented the
fork as a "linearize at copy time" step; updated to reflect the files are now
linear by construction. Verified: exactly one head (io_log), zero forks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant