Skip to content

fix(hub): apply the approval rounds migration on every database - #181

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-12140-apply-the-approval-rounds-migration-on-every-database
Nov 4, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-12140-apply-the-approval-rounds-migration-on-every-database

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Migration 0037 has a journal timestamp earlier than 0036's, so the migrator skipped it on any database already migrated past 0036. This adds migration 0038, generated with db:generate --custom and given a timestamp after every existing entry, which recreates the approval rounds table, its foreign keys and its index only where they are missing. 0037 is unchanged. A new test checks that journal timestamps increase, with 0037 as the one known exception.

Verified against a throwaway Postgres 17.11 with three databases. A fresh database migrated fully has the table, three foreign keys and the index. A database rolled back to 0036 still lacked the table after migrating with the old journal, and had it after migrating with this change. A fully migrated database migrated again succeeded with no error. The table definition was identical in all three. Lint, format check, typecheck, tests, pins:verify and vendor:verify pass.

Closes CL-12140

0037's journal timestamp sorts before 0036's, so the migrator skipped it on databases already past 0036. 0038 reapplies it idempotently, and a test keeps journal timestamps increasing.
@linear-code

linear-code Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

CL-12140

CL-12148

@TheGreatAxios
TheGreatAxios marked this pull request as ready for review November 4, 2026 23:09
@TheGreatAxios
TheGreatAxios merged commit 4db95c1 into main Nov 4, 2026
9 checks passed
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