1.3 KiB
1.3 KiB
Prisma migration baseline and Orchestration v4 rollout
The production databases predate complete migration tracking for the legacy governance tables (approval_requests, department_tasks, and audit_logs). Do not run prisma db push, reset, or edit an applied migration.
Safe baseline procedure (per environment, during a CI/CD maintenance step)
- Back up the database and verify restore capability.
- Run
prisma migrate statusand compare the live schema to the reviewed migrations. - For migrations whose objects already exist in that environment, record them without executing SQL using
prisma migrate resolve --applied <migration_name>. This is an environment-specific reconciliation step; never guess which migrations are present. - Review
20261022000000_add_orchestration_v4_core/migration.sql. It is additive: it creates onlyorchestration_*tables, indexes, and foreign keys. It does not alter or copy legacy governance data. - Apply through CI/CD only with
prisma migrate deploy; validate counts and application health. No production deployment is part of this change.
Rollback is application-first: stop use of the new module while retaining its append-only records. Do not drop tables in an automated rollback. Any later removal requires a separately reviewed archival migration.