fix(cms): move core_sync_states to proper Strapi migration#636
Merged
fix(cms): move core_sync_states to proper Strapi migration#636
Conversation
getAllSyncTimes selects the new stats columns (created, updated, etc.) but the migration that adds them only ran during runSync. If no sync has run since the deploy, the columns don't exist and the status endpoint crashes with a 500. Run ensureSyncStateTable before the query so the columns are always present. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace the runtime ensureSyncStateTable() DIY migration with a proper database migration that runs on boot. This ensures the table and stats columns exist before any status endpoint queries them, preventing 500s after deploys where no sync has run yet. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
core_sync_statestable creation from runtimeensureSyncStateTable()to a proper Strapi database migration that runs on boot/api/core-sync/statuscaused by querying stats columns that don't exist until a sync runscreated,updated,soft_deleted,errors) or adds the stats columns to existing tablesensureSyncStateTable()becomes a no-op since the migration handles everythingThis is the root fix for the "Development mode" showing on prod — the status endpoint was crashing because the stats columns didn't exist yet.
Test plan
🤖 Generated with Claude Code