db-push
Sync the Prisma schema to PostgreSQL using prisma db push (no migration files), regenerate the client, and restart the API server if needed. Use after editing schema.prisma.
SKILL.md.claude/skills/db-push/SKILL.md
GitHubdb-push
Per ADR 005, dev iteration uses prisma db push (not migrate dev) — no migration files in dev. This skill is the safe wrapper.
Steps
- Verify the schema parses before pushing:
cd data/schema && npx prisma validate - Check for destructive changes by running a diff first:
If Prisma warns about data loss, stop and ask the user. Don't passnpx prisma db push --accept-data-loss=false--accept-data-losswithout explicit permission. - Once safe, run the actual push:
npx prisma db push - Regenerate the client:
npx prisma generate - Restart the API server if it's running in the background — the new client types won't load otherwise.
- Update the vault — append the new model/column to
Aqarkom_Knowledge/Architecture/Database Schema.md. - Run
/typecheckto surface any type errors caused by the schema change.
Verification
- No data loss warnings (or user approved)
- Client regenerated
- API server restarted
- Schema vault note updated
-
/typecheckclean
Anti-patterns
- Don't bypass the data-loss check — even in dev, you may be dropping seeded test data the user wants
- Don't switch to
prisma migrate devwithout an ADR — that changes the project's workflow - Don't run against production —
db pushis dev-only