Moves migration handling into the pipeline and production deploy so
schema changes ship atomically with the code that depends on them.
Previously migrations were manual and the migrations/ directory was
gitignored, which caused silent drift between environments.
- Track packages/api/prisma/migrations/ in git (including the baseline
20260416000000_init and the family-tenant delta).
- Add `prisma:deploy` script that runs `prisma migrate deploy` (the
non-interactive, CI-safe command). `prisma:migrate` still maps to
`migrate dev` for local authoring.
- Pipeline test-api and e2e-tests jobs now use `prisma:deploy` and
test-api adds a drift check (`prisma migrate diff --exit-code`) that
fails the build if schema.prisma has changes without a corresponding
migration.
- deploy.sh runs migrations against prod using `docker run --rm` with
the freshly pulled API image before restarting containers, so a
failing migration aborts the deploy with the old containers still
serving traffic.
The [skip-deploy] tag avoids re-triggering deployment for this
infrastructure commit; the updated deploy.sh must be pulled to the
production host out-of-band before the next deployment benefits from
the new migration step.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>