-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "mysql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
enum GameType { | ||
P4_TOUPUUSEN | ||
P3_TOUPUUSEN | ||
P4_HANCHAN | ||
P3_HANCHAN | ||
} | ||
|
||
enum Wind { | ||
EAST | ||
SOUTH | ||
WEST | ||
NORTH | ||
} | ||
|
||
model User { | ||
userId Int @id @default(autoincrement()) | ||
displayName String | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
userScores UserScore[] | ||
} | ||
|
||
model GameRecord { | ||
gameId Int @id @default(autoincrement()) | ||
gameType GameType | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
userScores UserScore[] | ||
} | ||
|
||
model UserScore { | ||
userScoreId Int @id @default(autoincrement()) | ||
userId Int | ||
gameId Int | ||
initialSeat Wind | ||
score Int | ||
rank Int | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
user User @relation(fields: [userId], references: [userId]) | ||
gameRecord GameRecord @relation(fields: [gameId], references: [gameId]) | ||
} |