Open-Generative-AI/.env.example
Anuragp22 47dd61f33a feat(batch): add Prisma schema and Postgres wiring for batch feature
First slice of the CSV-driven batch video-generation feature. Introduces
the four-table schema (trainers, studios, batches, jobs) that the worker
and new /batch UI will operate on, plus the infrastructure glue so the
schema can be applied locally and in the docker-compose stack.

- prisma/schema.prisma: Trainer, Studio, Batch, Job models with the
  indexes the worker's claim query will need
  ([batchId, status] and [status, nextAttemptAt]).
- prisma/migrations/20260423011041_init_batch_schema: initial migration
  generated and applied against the compose Postgres.
- lib/prisma.js: standard Next.js PrismaClient singleton, reused across
  the web API routes and the worker process.
- docker-compose.yml: map Postgres to host port 5433 to avoid colliding
  with a pre-existing local Postgres on 5432; wire MUAPI_API_KEY env
  through web and worker; add uploads_data volume mounted at
  /data/uploads for slice-2 trainer/studio image backups.
- .env.example: documented DATABASE_URL (5433 for host, 5432 for
  in-compose) and MUAPI_API_KEY placeholders.
- .gitignore: ignore /data/uploads/ now so future runtime uploads
  don't end up tracked.

Also downgraded prisma from 7.x to ^6 since 7 moved datasource config
out of schema.prisma into a separate prisma.config.ts (breaking change
we don't need to absorb yet).

No API routes, worker, or UI in this slice — those land in the next
branches (feat/trainers-studios-crud, feat/batch-create-csv, etc).
2026-04-23 06:41:31 +05:30

12 lines
670 B
Bash

# Postgres connection for the batch feature.
# When running via docker compose, this is the in-network URL:
# postgresql://ogai:ogai_dev_pw@postgres:5432/ogai
# When running `prisma migrate dev` from the host, use localhost:5433
# (the compose file maps the container's 5432 -> host 5433 to avoid
# colliding with a local Postgres install already using 5432).
DATABASE_URL=postgresql://ogai:ogai_dev_pw@localhost:5433/ogai
# Shared MuAPI API key used by the worker to submit video-generation jobs.
# The web container reads it too for server-side cost-estimate fallback.
# Per-user client calls still come from the browser cookie (existing behaviour).
MUAPI_API_KEY=