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:pushInspect local data with:
bun run db:studioSeed 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:sitesApply shared-environment changes
Generate and review a migration, then apply it:
bun run db:generate
bun run db:migrateAvoid db:push against shared or production data because it can apply schema
changes without a reviewed migration history.