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
Audience: Developers and AI agents applying schema changes through Lovable + Supabase.
Why this exists
Lovable can apply schema changes directly to hosted DEV. Those changes do not automatically create local migration files, so drift can accumulate unless we capture it promptly. This workflow keeps hosted DEV,supabase/migrations/, and optional declarative files aligned.
Required workflow after Lovable schema edits
- Run drift capture:
-
Review the generated migration in
supabase/migrations/:- verify no unintended
DROPor destructive DDL - confirm RLS/policy changes follow constitution requirements
- confirm lane expectations from
docs/development/supabase/MIGRATION_LANES.md
- verify no unintended
- Validate locally:
- If declarative schema is bootstrapped, refresh it:
- Commit migration (and declarative updates when present) in the same PR.
Guardrails
supabase/migrations/*.sqlis the only deployment/promotions source of truth.- Never promote Lovable-only hosted changes without an accompanying migration file.
- Do not include tenant/demo data in migrations.
- If
db:pull-from-devreturns no diff, do not create a no-op migration. - For partitioned-table changes, use the two-phase safety pattern from
ADR-020:- phase 1 = shadow partition tables + sync triggers (no cutover),
- phase 2 = explicit backfill/parity checks/cutover in an approved window.
Troubleshooting
-
Missing required env var: SUPABASE_DEV_PROJECT_ID
SetSUPABASE_DEV_PROJECT_ID(normallyzkgxozahyczcnzpwhbbf). -
Missing required env var: SUPABASE_ACCESS_TOKEN
Export a Supabase personal access token with project link permissions. -
Catalog/doc refresh missing DB credentials
SetSUPABASE_DEV_DB_PASSWORD(orSUPABASE_DEV_DB_URL) before running hosted catalog export scripts.