Initial commit - Prode Mundial 2026

This commit is contained in:
2026-06-11 11:22:46 -03:00
commit 22c6f93e78
45 changed files with 2112 additions and 0 deletions
+77
View File
@@ -0,0 +1,77 @@
generator client {
provider = "prisma-client-js"
output = "../node_modules/.prisma/client"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
email String @unique
password String
name String
role String @default("PLAYER")
predictions Prediction[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Team {
id String @id @default(cuid())
name String
shortName String @unique
isoCode String @unique
group String
groupOrder Int
confederation String
homeMatches Match[] @relation("HomeTeam")
awayMatches Match[] @relation("AwayTeam")
@@index([group])
}
model Match {
id String @id @default(cuid())
matchNumber Int @unique
phase String
group String?
matchday Int?
homeTeam Team? @relation("HomeTeam", fields: [homeTeamId], references: [id])
homeTeamId String?
awayTeam Team? @relation("AwayTeam", fields: [awayTeamId], references: [id])
awayTeamId String?
homeLabel String?
awayLabel String?
scheduledAt DateTime
venue String?
homeScore Int?
awayScore Int?
status String @default("SCHEDULED")
predictions Prediction[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([phase])
@@index([group])
@@index([status])
@@index([scheduledAt])
}
model Prediction {
id String @id @default(cuid())
user User @relation(fields: [userId], references: [id])
userId String
match Match @relation(fields: [matchId], references: [id])
matchId String
result String
points Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([userId, matchId])
@@index([userId])
@@index([matchId])
}