Database
The Flow-Like API stores platform data in a PostgreSQL-compatible relational
database. The Prisma schema is under packages/api/prisma/schema/.
Internal Database
Section titled “Internal Database”database.type: internal deploys one CockroachDB pod:
database: type: internal internal: replicas: 1 persistence: storageClass: "" size: 10GiThis workload runs CockroachDB with start-single-node --insecure. It is a
convenient evaluation and development database, not a highly available or
TLS-hardened production topology.
Do not increase database.internal.replicas. Multiple independent
start-single-node pods do not form a CockroachDB cluster.
External Database
Section titled “External Database”Use an externally operated PostgreSQL or CockroachDB service for production:
database: type: external external: existingSecret: flow-like-databaseThe named Secret must contain one key:
The URL is consumed by both the API and the migration Job. Keep it in an
externally managed Kubernetes Secret; avoid database.external.connectionString
in shared or committed values files.
See Installation for a command that creates the Secret without putting the URL in shell history.
Schema Application
Section titled “Schema Application”The chart enables database.migration by default:
database: migration: enabled: true image: repository: registry.example.com/flow-like/migration tag: replace-me pullPolicy: IfNotPresentThe Job waits on DATABASE_URL, then runs Prisma schema push during install
and upgrade. For the internal database it is a post-install hook; for an
external database it is a pre-install hook.
The current migration command uses prisma db push --accept-data-loss.
Review that behavior against your backup, change-management, and production
migration policy. To manage schema changes separately, set
database.migration.enabled: false and run an approved migration process
before rolling out the API.
The repository helper can run the same schema push from a trusted workstation.
Put DATABASE_URL in the ignored apps/backend/kubernetes/.env file first:
cd apps/backend/kubernetes./scripts/migrate-db.shIt also accepts --docker when the local Docker Compose migration service is
configured.
Verification
Section titled “Verification”Check the API’s Secret reference and database readiness without printing the credential:
kubectl get secret flow-like-database -n flow-likekubectl logs -n flow-like -l app.kubernetes.io/component=db-migrationkubectl rollout status deployment/flow-like-api -n flow-likeSuccessful Helm hook Jobs may already have been deleted according to the
chart’s hook policy. Use helm status and namespace events when no migration
pod remains.