fix(migrations): renumber the AI-support migration above the release line - #323
Merged
Merged
Conversation
…line `202607050000000_add_ai_support_agent_tables.sql` is 15 digits where every recent migration is 17, so its version_id is ~100x smaller than the migrations already applied everywhere: already applied on any 2.2607.3 database : 20,260,730,100,500,000 the AI-support migration : 202,607,050,000,000 micrate sorts by version_id, so this lands BEFORE migrations that are already applied and `verify_unordered_migrations` raises `Micrate::UnorderedMigrationsException` — at which point NOTHING further applies, including 20260730101000000_alter_user_logged_out_at_timestamptz. This is not hypothetical. It is already breaking the dev server: `init` is crash-looping on exactly this exception right now, and a scan of every migration against dev's applied set shows this file is the ONLY one out of order. Padding to 17 digits would not be enough — 2026-07-05 still predates the 2026-07-30 migrations already in the field — so it is renumbered to 20260806100500000, above everything currently released. Renaming is safe here: the migration has not been applied anywhere (no `micrate_db_version` row for it on dev), and every statement in it is `CREATE TABLE/INDEX IF NOT EXISTS` (12 tables, 52 indexes), so even a re-application would be a no-op. Nothing in the codebase references the filename. Content is untouched — this is a pure rename. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
202607050000000_add_ai_support_agent_tables.sqlis 15 digits where every recent migration is 17. Itsversion_idis therefore ~100× smaller than migrations already applied in the field:micrate sorts by
version_id, so this migration lands before ones that are already applied, andverify_unordered_migrationsraisesMicrate::UnorderedMigrationsException. At that point nothing further applies — including20260730101000000_alter_user_logged_out_at_timestamptz.sql.This is already happening
The dev server's
initis crash-looping on exactly this right now:I compared every migration on disk against dev's applied set. This file is the only one out of order.
It would also have broken the next platform release: any client database at
2.2607.3has20260730100500000applied, so this migration would refuse on upgrade and take the rest of the chain with it.The fix
Renumbered to
20260806100500000— above everything currently released.Padding to 17 digits alone would not be sufficient:
20260705000000000still predates the 2026-07-30 migrations already in the field.Why renaming is safe here
micrate_db_versionrow for it on devCREATE TABLE/INDEX IF NOT EXISTS(12 tables, 52 indexes), so even a re-application on a database that somehow had it would be a no-opContent is untouched. This is a pure rename.