fix: detect and re-run migration 029 when forms tables are missing#779
Merged
fix: detect and re-run migration 029 when forms tables are missing#779
Conversation
) Migration ID 029 was reassigned from "Ai Search Plugin" to "Add Forms System" between releases. Users upgrading from older versions had 029 marked as applied for the wrong migration, causing forms tables to never be created and cascading failures for migrations 030 and 033. - Add bidirectional auto-detection for migration 029 in autoDetectAppliedMigrations(): if 029 is recorded but forms tables don't exist, remove the stale record so it re-runs - Include per-migration error details in admin API response instead of generic "Failed to run migrations" - Add unit tests for all four detection scenarios Co-Authored-By: Claude Opus 4.6 <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.
Summary
029was reassigned from "Ai Search Plugin" to "Add Forms System" between releases. Users upgrading from older versions had029marked as applied for the wrong migration, causing forms tables to never be created and cascading failures for migrations030and033.029inautoDetectAppliedMigrations(): if029is recorded butforms/form_submissions/form_filestables don't exist, the stale record is removed so the forms migration re-runs on next bootstrap.Changes
packages/core/src/services/migrations.tserrorsarray torunPendingMigrations()return typepackages/core/src/routes/admin-api.tsPOST /migrations/runresponsepackages/core/src/services/migrations.test.tsdocs/ai/plans/fix-762-migration-029-reuse-plan.mdTesting
Test plan
🤖 Generated with Claude Code