Skip to content

Add production Prisma schema for minesweeper#1

Open
ayush99336 wants to merge 1 commit intoKhel-fun:mainfrom
ayush99336:prisma-schema
Open

Add production Prisma schema for minesweeper#1
ayush99336 wants to merge 1 commit intoKhel-fun:mainfrom
ayush99336:prisma-schema

Conversation

@ayush99336
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings March 30, 2026 12:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.prisma from 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.

Comment on lines +78 to +81
xpEarned Int @default(0)
revealedSafeCount Int @default(0)
moveCount Int @default(0)
mineHitOnMove Int?
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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?

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +130
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
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants