Cofounder Docs
Migrations
Understand how database migrations work in the managed app repo.
Migrations
Use migrations for database schema changes in the managed app repo.
That includes changes like:
- adding tables
- changing columns
- updating indexes or other schema-level database setup
If you are adding tables, this is the workflow to use.
In practice, have the Engineer agent work on the schema change and add the migration in the app repository.
Where Migrations Live
Migrations live in supabase/migrations/ in the app repository.
How The Workflow Works
- Add the migration file in the app repository.
- Have the Engineer request a deploy so the migration work can reach staging.
- While the handoff is open, automated checks can lint the migration files.
- When the change reaches staging (staging publish / Publish to Staging), the staging migration path runs automatically.
- When those changes are later published to production, the production migration path runs automatically.
Staging And Production
- shipping a migration to staging applies it to staging
- publishing to production applies it to production
That keeps migrations lined up with the same staging-to-production flow as the app code. Requesting a deploy is the normal agent path to staging; workspace Publish is the path to production.