Skip to content

feat(backend,ci): add database migration CI smoke test and rollback procedure (#440) - #512

Merged
Viky207 merged 1 commit into
Viky207:mainfrom
bonatkenneth-web:feat/440-migration-ci-and-rollback
Oct 23, 2026
Merged

Viky207 merged 1 commit into
Viky207:mainfrom
bonatkenneth-web:feat/440-migration-ci-and-rollback

Conversation

@bonatkenneth-web

@bonatkenneth-web bonatkenneth-web commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Closes #440
closes #437
closes #438
closes #439

Adds an automated database migration CI smoke-test job, a rollback script for reverting the most recent migration, CD deployment gating on migration verification, and comprehensive rollback runbook documentation.

Changes

  • Migration Runner (app/backend/run-migration-supabase.js): Applies all migrations in app/backend/supabase/migrations/ in sequential order against a fresh test schema (--smoke-test), tracks applied versions in schema_migrations, and asserts that the resulting schema matches expected tables, views, functions, and indexes.
  • Rollback Script (scripts/rollback-migration.sh & scripts/rollback-migration.test.js): Reverts the most recent migration (with support for --dry-run, --steps, --target, --state-file, --schema, --json, and a production confirmation guard) and adds automated tests.
  • CI & CD Workflows (.github/workflows/ci.yml, .github/workflows/cd.yml): Adds the migration-smoke-test job to ci.yml and cd.yml and blocks the release job in cd.yml if migration-smoke-test fails.
  • Documentation (docs/MIGRATION-RUNBOOK.md, docs/RUNTIME-CONFIG-MATRIX.md, docs/DEPLOYMENT-RUNBOOK.md): Documents the migration architecture, CI/CD gates, and step-by-step rollback procedure.

@Viky207
Viky207 merged commit 1d5086a into Viky207:main Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants