Docs
Configure

Connect a database

Configure PostgreSQL and apply the schema.

Connect a database

Set DATABASE_URL in the root .env.local file. The shared @repo/database package owns the Drizzle client, schema exports, tenant helpers, and data-access helpers used by the app and other packages.

Apply local changes

bun run db:push

Inspect local data with:

bun run db:studio

Seed the default tenant and its first site admin, then one tenant per site (from each sites/*/src/site.config.ts):

bun run db:seed
bun run db:seed:sites

Apply shared-environment changes

Generate and review a migration, then apply it:

bun run db:generate
bun run db:migrate

Avoid db:push against shared or production data because it can apply schema changes without a reviewed migration history.

On this page