Postgres deployment
Provision a standard Postgres-compatible database and apply migrations.
Create one database per environment. Fabric-managed environments use Databricks Lakebase Postgres (see Databricks deployment); other standard Postgres providers are valid if migrations pass.
export DATABASE_URL=postgres://...
for f in infra/neon/migrations/*.sql; do
psql "$DATABASE_URL" -f "$f"
done(infra/neon/migrations holds provider-neutral Postgres migrations; the directory name is historical. On Lakebase, use DATABASE_PROVIDER=databricks-lakebase pnpm migrate instead — see Databricks deployment.)
Store the resulting DATABASE_URL in the staging secrets vault and in the API deployment environment.
Test strategy
Better Auth integration tests should use real Postgres via Testcontainers, service-container Postgres, or per-PR Neon branches. Avoid pglite/Kysely dialect shortcuts for production auth confidence.