Skip to content

fix(cms): move core_sync_states to proper Strapi migration#636

Merged
tataihono merged 2 commits intomainfrom
fix/core-sync-migration
Apr 2, 2026
Merged

fix(cms): move core_sync_states to proper Strapi migration#636
tataihono merged 2 commits intomainfrom
fix/core-sync-migration

Conversation

@tataihono
Copy link
Copy Markdown
Contributor

Summary

  • Move core_sync_states table creation from runtime ensureSyncStateTable() to a proper Strapi database migration that runs on boot
  • Fixes the 500 on /api/core-sync/status caused by querying stats columns that don't exist until a sync runs
  • The migration creates the table with all columns (including created, updated, soft_deleted, errors) or adds the stats columns to existing tables
  • ensureSyncStateTable() becomes a no-op since the migration handles everything

This 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

  • Verify Core Sync card shows production UI on prod (no "Development mode")
  • Verify phase watermarks with row counts display after sync completes
  • Verify fresh database gets the full table schema on first boot

🤖 Generated with Claude Code

tataihono and others added 2 commits April 2, 2026 01:40
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]>
@tataihono tataihono merged commit 4b9d471 into main Apr 2, 2026
8 checks passed
@tataihono tataihono deleted the fix/core-sync-migration branch April 2, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant