Skip to main content
Migrations live in db/migrations/. Run them in filename order for a fresh project. The onboarding wizard can apply them automatically via one-click schema install.

Migration files

Migration CLI

The @yourhq/migrate package provides a CLI for applying schema migrations directly against Postgres (session mode, port 5432).
The runner tracks applied migrations in a _yourhq_migrations table (version, checksum, applied_at). It verifies checksums on already-applied migrations to detect drift. Each migration runs in a transaction — if one fails, it rolls back and stops. For Cloud Supabase users who can’t access port 5432, the onboarding wizard provides a “Copy SQL → Open SQL Editor” manual flow.

Applying migrations

Run every .sql file in order from the Supabase SQL Editor, or use the onboarding wizard which concatenates them into a single copy-paste blob.
Always include explicit GRANT statements for authenticated and service_role in any new migrations. Supabase does not grant these by default.