apps/api gains Prisma (instance_settings as the first model) with the initial migration applied automatically at startup via prisma migrate deploy, a lazy-connecting PrismaService, and GET /api/v1/readyz reporting named checks (database reachable, migrations applied) with 200/503. DATABASE_URL joins the validated environment schema; MIGRATE_ON_START=false skips deploys for tests and tooling. An idempotent seed script and a Compose dev overlay with PostgreSQL (host port 5434 — 5433 is taken locally) complete the loop. Closes #3 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
661 B
Plaintext
24 lines
661 B
Plaintext
// Prisma schema — the single source of truth for the database structure.
|
|
// The entity documentation lives in docs/architecture/data-model.md; keep
|
|
// both in sync when the schema evolves.
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
/// Typed key-value configuration for the instance (registration mode,
|
|
/// default quotas, legal pages, …). Values are validated with Zod before
|
|
/// writing; see the InstanceSettings service (issue #19).
|
|
model InstanceSetting {
|
|
key String @id
|
|
value Json
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@map("instance_settings")
|
|
}
|