Version: 1.0.0Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Last Updated: 2026-05-13
Owner: Platform / Database maintainers
Scope
This runbook documents the safe path for promoting migrations from repo state to hosted production Supabase. Use this for both:- normal release promotion, and
- targeted catch-up windows when production trails development.
Preconditions
- PR to
productionincludes reviewed migration files. db-migration-guardandsupabase-cichecks are green.- Supabase credentials are available in CI/secrets (or local env for manual path):
SUPABASE_ACCESS_TOKENSUPABASE_PROJECT_ID/ project link context
Standard promotion path (preferred)
- Open PR targeting
production. - Confirm migration review, lane checks, and dry-run outputs.
- Merge PR.
- Observe
.github/workflows/supabase-deploy-prod.ymlexecution. - Confirm
supabase db pushsuccess in workflow logs.
Manual fallback path
If CI deployment is unavailable, run manually from a clean checkout:Post-promotion verification checklist
-
supabase db pushcompleted with no failed migrations. - Hosted PROD catalog snapshot refreshed successfully.
-
docs/database/SCHEMA_CATALOG.PROD.mdregenerated. - DEV vs PROD table/policy deltas reviewed for expected differences only.
- Any follow-up drift or hotfix migration captured in a new PR (no direct manual DDL drift).
Catch-up window notes
For multi-file catch-up batches:- Review each pending migration for destructive operations (
DROP TABLE,DROP COLUMN,ALTER TYPE,DROP FUNCTION). - Verify index statements are transaction-safe for Supabase migrations (avoid
CONCURRENTLYinside transactional migrations unless explicitly supported by tooling). - If a migration fails mid-batch, author a forward-fix migration; do not rewrite applied production migration history.
Partition migrations (two-phase safety)
When a batch includes partition strategy migrations (seeADR-020), treat cutover as a separate tracked operation:
- Phase 1 only in standard promotion: shadow partition table, sync trigger, helper functions.
- Backfill and parity checks: before any rename/swap, validate row-count variance within 0.1% (or <= 100 rows absolute), compute sampled record hashes with SHA-256 (1% sample up to 10,000 rows per partition), and include recent + overlap windows for time partitions (for example, last 30 days plus prior 7-day overlap). Reference ADR-020 and this runbook’s cutover checklist for evidence capture.
- Cutover window: perform writer/read-path cutover in an explicit maintenance window with rollback criteria.
- Retention drops: run prune helpers with dry-run first, review output, then execute.
Current catch-up batch (after PROD 20260512220528)
20260512231500_cl46_fix_problem_permission_helper.sql20260513041000_ce13_sequence_alignment.sql20260513042000_ce13_sequence_permissions.sql20260513043000_ce13_sequence_executor_cron.sql20260513050000_ce13_active_enrollment_index_concurrently.sql20260513051000_ce13_reorder_sequence_steps_rpc.sql20260513052000_ce13_sequence_delete_policies_admin.sql20260513120123_permissions_sync_eba09871.sql20260513122600_fix_fw_execution_worker_role_assignments.sql20260513124500_ce08_enhancements_schema_foundation.sql20260513125500_fix_form_analytics_cron_and_backfill.sql20260513130700_fix_fw_enqueue_submission_automations_trigger.sql20260513132700_fix_form_completion_metrics_rls_args.sql20260513175000_permissions_sync_pf30_nav_permission_backfill.sql