Add production Prisma schema for minesweeper#1
Add production Prisma schema for minesweeper#1ayush99336 wants to merge 1 commit intoKhel-fun:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a production-ready Prisma data model for Minesweeper, including persistent tracking of players, games, moves, ZK proof attempts, verification jobs, attestations, and on-chain publications.
Changes:
- Expanded
schema.prismafrom a minimal game/cell schema into a full production schema (players, moves, proofs, verification, publications). - Introduced enums to model move outcomes, circuit kinds, proof/verification/publication lifecycle states.
- Added a workspace VS Code setting related to Prisma extension behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/db/prisma/schema/schema.prisma | Introduces production DB schema for Minesweeper gameplay + ZK proof/verification/publication tracking. |
| .vscode/settings.json | Adds Prisma extension setting for the repo workspace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| xpEarned Int @default(0) | ||
| revealedSafeCount Int @default(0) | ||
| moveCount Int @default(0) | ||
| mineHitOnMove Int? |
There was a problem hiding this comment.
This schema changes Game fields used by existing code (e.g., packages/api/src/routers/game.ts reads/writes xp, proofHex, and proofStatus). After prisma generate, those properties will no longer exist (replaced by xpEarned and the new proof tables), so the API will fail to compile/run until it’s migrated accordingly.
| xpEarned Int @default(0) | |
| revealedSafeCount Int @default(0) | |
| moveCount Int @default(0) | |
| mineHitOnMove Int? | |
| xp Int @default(0) | |
| revealedSafeCount Int @default(0) | |
| moveCount Int @default(0) | |
| mineHitOnMove Int? | |
| proofHex String? | |
| proofStatus String? |
| gameId String @db.Uuid | ||
| moveId String @db.Uuid | ||
| game Game @relation(fields: [gameId], references: [id], onDelete: Cascade) | ||
| move GameMove @relation(fields: [moveId], references: [id], onDelete: Cascade) | ||
| cellIndex Int |
There was a problem hiding this comment.
GameMoveCell includes both gameId and moveId, but there’s no DB constraint ensuring the referenced GameMove belongs to the same gameId. This permits inconsistent rows. Consider deriving gameId through move (drop the extra column) or modeling the relation with a composite key so consistency is enforceable.
No description provided.