Database migration center

Run Supabase SQL safely, even after partial migrations.

This center consolidates the safe execution order and repair files for common Supabase errors: missing columns, enum re-creation, helper-function parameter changes, and legacy deployment run constraints.

Execution order

Use this order for upgrades and fresh Supabase projects.

Step 1

Run compatibility repair pack

Repairs older Supabase databases before schema/seed execution.

File: docs/database-compatibility-fixes.sql

When: First, especially after any error involving missing columns, enum recreation, helper functions, or deployment_runs.version.

low risk
Step 2

Apply safe schema

Creates and upgrades tables, indexes, extension assumptions, and compatibility columns.

File: docs/supabase-schema.sql

When: After compatibility repair pack. Safe to rerun.

medium risk
Step 3

Apply RLS policies

Drops/recreates known policies and helper functions with stable parameter names.

File: docs/rls-policies.sql

When: After schema exists. Rerun after changing table names, policy names, or auth logic.

medium risk
Step 4

Seed deterministic demo data

Creates global demo organization, nodes, telemetry, incidents, contracts, and deployment runs.

File: docs/seed-demo.sql

When: Optional. Use in demo/staging. Review before running in production.

medium risk
Database Migration Center | UmamiEdge