Safely updates PURA database schema and data workflows using Prisma in the monorepo (schema changes, db push/migrate, generate, seed, verification, and tests). Use when editing packages/database/prisma/schema.prisma, adding financial tables, changing indexes/constraints, or when deployments require migration steps.
Use this for changes in packages/database (Prisma + seed + DB tests) and for coordinating API/Web changes that depend on schema updates.
packages/database/prisma/schema.prismapackages/database/package.json scripts@pura/database (workspace dependency)@db.Date) when used as accounting day.businessDateModify packages/database/prisma/schema.prisma:
PURA uses Prisma Migrate as the primary workflow:
pnpm --filter database exec prisma generatepnpm --filter database exec prisma migrate devpnpm --filter database exec prisma migrate deploy (see DEPLOYMENT.md)Rules of thumb:
prisma migrate dev so migration history stays consistent.prisma migrate deploy (never db push).Use existing scripts (see packages/database/package.json):
pnpm --filter database db:seedpnpm --filter database db:seed-financialpnpm --filter database db:verify-seedWhen changing financial schema, update seed-financial.ts and add a verification step (either in verify-seed.mts or DB tests).
Where:
packages/database/prisma/*.test.tsMinimum expectations:
Run:
pnpm --filter database testFollow DEPLOYMENT.md:
@pura/database build generates Prisma client)pnpm --filter database exec prisma migrate deploy