DB Migration
Create and apply Prisma migrations for TikTok-AI-Agent.
Input
- •Description of the change (e.g. "add Project.costCents") or concrete diff. Optionally a migration name.
Steps
- •Edit schema – Update
apps/server/prisma/schema.prisma. Keep relations,@id,@default, etc. consistent. - •Create migration – From repo root:
- •
npm run db:migrate:dev(creates and applies in dev), or - •
cd apps/server && npx prisma migrate dev --name <snake_case_name>.
- •
- •Verify – Run
npx prisma generate(ornpm run db:generate) and ensure the app typechecks. Runnpm run testif touching code that uses the new schema. - •Report – "Migration created and applied" or "Migration failed: …" with next steps (e.g. fix schema, resolve conflicts).
Output
- •Updated
schema.prismaand a new migration underapps/server/prisma/migrations/. - •Short summary: success or failure and what to do next.
References
- •apps/server/prisma/schema.prisma
- •AGENTS.md –
db:generate,db:migrate:dev - •.cursor/rules/always-project-standards.mdc – DB section