Imported from rafalszoltysik/Squimbo (
.cursor/skills/friends-prisma-db/SKILL.md). Install upstream withnpx skills add rafalszoltysik/Squimbo --skill friends-prisma-db. Copyright stays with the author.
Squimbo Prisma & database
Read first
- packages/db/README.md
packages/db/prisma/schema.prisma- Prisma plugin:
schema-conventions,migration-best-practices
Domain → API
| Domain | Models | API |
|---|---|---|
| Identity | User (discordId) |
discord/, auth/ |
| Match | GameRoom, RoomPlayer |
game/ |
| Catalog | Prompt |
seed + game/ |
| Play | Round, Vote |
game/ |
Execution order
- Align names with existing schema; both sides of relations;
createdAt/updatedAt. - Edit
schema.prisma;pnpm db:migratefrom root (notdb:pushfor prod-bound changes). - Update Nest services; always scope by authenticated user / membership.
- Seed the
most_likelybank frompackages/db/prisma/prompt-bank.ts. Insert English rows only (Prompt_locale_en_only_check). Each entry also hasbodyPlfor a later PL bank; do not insertlocale = pluntil product + a migration drop that check. - Seed syncs (update via
replacesto keepPrompt.id, insert missing, delete unreferenced leftovers). Do not wipe rounds/votes. No--forcein production. - Prompt quality: docs/prompt-content.md. Mix editorial themes in
prompt-bank.ts. No pack picker. Do not add spice / theme Prisma columns unless schema + migration are explicitly required. - Tests per
friends-testing.
Commands
pnpm db:up
pnpm db:migrate
pnpm db:seed
pnpm db:generate