Files
zeekayandHanzo Dev fa7c528ae4 feat(db): migrate Prisma datasource postgres -> sqlite (native, file-backed)
Drops the shared sql-0 postgres dependency in favor of an embedded SQLite
file (DATABASE_URL=file:/data/<db>), WAL-replicated to SeaweedFS by the
operator persistence sidecar — same pattern as esign (Documenso).

Schema changes for the sqlite connector:
- datasource provider postgresql -> sqlite; drop directUrl/shadowDatabaseUrl
- 18 enums -> String (values preserved as string defaults)
- scalar-list fields (String[]/Int[]) -> Json @default("[]") (arrays
  round-trip through Prisma Json at runtime; next.config ignoreBuildErrors
  keeps the type-only churn out of the build)
- strip pg-native @db.* attributes (@db.Text/@db.Timestamp)
- startup: prisma migrate deploy -> prisma db push (pg migration history is
  postgres-specific; db push reconciles the sqlite schema idempotently)

CI: amd64-only (DOKS has no arm64); deploy:false — rollout is operator-managed
via the universe Service CR, never `kubectl set image`.

Verified: `prisma validate` + `prisma db push` materialize all 62 tables on a
fresh sqlite file. Source DB is empty (0 app rows), so cutover is data-safe.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-05 00:33:13 -07:00

32 lines
743 B
Plaintext

// Jackson SAML/SCIM tables
// These are managed by @boxyhq/saml-jackson internally.
// We define them here so Prisma is aware of the tables and
// migrations stay in sync with the main app schema.
model jackson_index {
id Int @id @default(autoincrement())
key String
storeKey String
@@index([key, storeKey], map: "_jackson_index_key_store")
}
model jackson_store {
key String @id
value String
iv String?
tag String?
namespace String?
createdAt DateTime @default(now())
modifiedAt DateTime?
@@index([namespace], map: "_jackson_store_namespace")
}
model jackson_ttl {
key String @id
expiresAt BigInt
@@index([expiresAt], map: "_jackson_ttl_expires_at")
}