+122
-98
@@ -42,22 +42,22 @@ model League {
|
||||
}
|
||||
|
||||
model Team {
|
||||
id String @id
|
||||
name String
|
||||
slug String?
|
||||
sport Sport
|
||||
logoUrl String? @map("logo_url")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
awayMatchesLive LiveMatch[] @relation("AwayTeamLive")
|
||||
homeMatchesLive LiveMatch[] @relation("HomeTeamLive")
|
||||
playerEvents MatchPlayerEvents[]
|
||||
playerParticipations MatchPlayerParticipation[]
|
||||
id String @id
|
||||
name String
|
||||
slug String?
|
||||
sport Sport
|
||||
logoUrl String? @map("logo_url")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
awayMatchesLive LiveMatch[] @relation("AwayTeamLive")
|
||||
homeMatchesLive LiveMatch[] @relation("HomeTeamLive")
|
||||
playerEvents MatchPlayerEvents[]
|
||||
playerParticipations MatchPlayerParticipation[]
|
||||
basketballPlayerStats BasketballPlayerStats[]
|
||||
footballTeamStats FootballTeamStats[]
|
||||
basketballTeamStats BasketballTeamStats[]
|
||||
awayMatches Match[] @relation("AwayTeam")
|
||||
homeMatches Match[] @relation("HomeTeam")
|
||||
eloRating TeamEloRating?
|
||||
footballTeamStats FootballTeamStats[]
|
||||
basketballTeamStats BasketballTeamStats[]
|
||||
awayMatches Match[] @relation("AwayTeam")
|
||||
homeMatches Match[] @relation("HomeTeam")
|
||||
eloRating TeamEloRating?
|
||||
|
||||
@@index([name])
|
||||
@@index([sport])
|
||||
@@ -80,24 +80,24 @@ model Player {
|
||||
}
|
||||
|
||||
model Match {
|
||||
id String @id
|
||||
leagueId String? @map("league_id")
|
||||
homeTeamId String? @map("home_team_id")
|
||||
awayTeamId String? @map("away_team_id")
|
||||
id String @id
|
||||
leagueId String? @map("league_id")
|
||||
homeTeamId String? @map("home_team_id")
|
||||
awayTeamId String? @map("away_team_id")
|
||||
sport Sport
|
||||
matchName String? @map("match_name")
|
||||
matchSlug String? @map("match_slug")
|
||||
mstUtc BigInt @map("mst_utc")
|
||||
matchName String? @map("match_name")
|
||||
matchSlug String? @map("match_slug")
|
||||
mstUtc BigInt @map("mst_utc")
|
||||
status String?
|
||||
state String?
|
||||
scoreHome Int? @map("score_home")
|
||||
scoreAway Int? @map("score_away")
|
||||
htScoreHome Int? @map("ht_score_home")
|
||||
htScoreAway Int? @map("ht_score_away")
|
||||
scoreHome Int? @map("score_home")
|
||||
scoreAway Int? @map("score_away")
|
||||
htScoreHome Int? @map("ht_score_home")
|
||||
htScoreAway Int? @map("ht_score_away")
|
||||
winner String?
|
||||
iddaaCode String? @map("iddaa_code")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
iddaaCode String? @map("iddaa_code")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
footballAiFeatures FootballAiFeature?
|
||||
basketballAiFeatures BasketballAiFeature?
|
||||
officials MatchOfficial[]
|
||||
@@ -106,11 +106,12 @@ model Match {
|
||||
basketballPlayerStats BasketballPlayerStats[]
|
||||
footballTeamStats FootballTeamStats[]
|
||||
basketballTeamStats BasketballTeamStats[]
|
||||
awayTeam Team? @relation("AwayTeam", fields: [awayTeamId], references: [id])
|
||||
homeTeam Team? @relation("HomeTeam", fields: [homeTeamId], references: [id])
|
||||
league League? @relation(fields: [leagueId], references: [id])
|
||||
awayTeam Team? @relation("AwayTeam", fields: [awayTeamId], references: [id])
|
||||
homeTeam Team? @relation("HomeTeam", fields: [homeTeamId], references: [id])
|
||||
league League? @relation(fields: [leagueId], references: [id])
|
||||
oddCategories OddCategory[]
|
||||
prediction Prediction?
|
||||
predictionOutcomes PredictionOutcome[]
|
||||
couponItems UserCouponItem[]
|
||||
|
||||
@@index([awayTeamId])
|
||||
@@ -270,25 +271,25 @@ model TeamEloRating {
|
||||
}
|
||||
|
||||
model MatchPlayerEvents {
|
||||
id Int @id @default(autoincrement())
|
||||
matchId String @map("match_id")
|
||||
playerId String @map("player_id")
|
||||
teamId String @map("team_id")
|
||||
eventType EventType @map("event_type")
|
||||
eventSubtype String? @map("event_subtype")
|
||||
timeMinute String @map("time_minute")
|
||||
timeSeconds Int? @map("time_seconds")
|
||||
periodId Int? @map("period_id")
|
||||
assistPlayerId String? @map("assist_player_id")
|
||||
scoreAfter String? @map("score_after")
|
||||
playerOutId String? @map("player_out_id")
|
||||
position MatchPosition?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
assistPlayer Player? @relation("AssistPlayer", fields: [assistPlayerId], references: [id])
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
player Player @relation("EventPlayer", fields: [playerId], references: [id], onDelete: Cascade)
|
||||
substitutedOut Player? @relation("SubstitutedOut", fields: [playerOutId], references: [id])
|
||||
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
id Int @id @default(autoincrement())
|
||||
matchId String @map("match_id")
|
||||
playerId String @map("player_id")
|
||||
teamId String @map("team_id")
|
||||
eventType EventType @map("event_type")
|
||||
eventSubtype String? @map("event_subtype")
|
||||
timeMinute String @map("time_minute")
|
||||
timeSeconds Int? @map("time_seconds")
|
||||
periodId Int? @map("period_id")
|
||||
assistPlayerId String? @map("assist_player_id")
|
||||
scoreAfter String? @map("score_after")
|
||||
playerOutId String? @map("player_out_id")
|
||||
position MatchPosition?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
assistPlayer Player? @relation("AssistPlayer", fields: [assistPlayerId], references: [id])
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
player Player @relation("EventPlayer", fields: [playerId], references: [id], onDelete: Cascade)
|
||||
substitutedOut Player? @relation("SubstitutedOut", fields: [playerOutId], references: [id])
|
||||
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([assistPlayerId])
|
||||
@@index([eventType])
|
||||
@@ -319,28 +320,28 @@ model MatchPlayerParticipation {
|
||||
}
|
||||
|
||||
model BasketballPlayerStats {
|
||||
id Int @id @default(autoincrement())
|
||||
matchId String @map("match_id")
|
||||
playerId String @map("player_id")
|
||||
teamId String @map("team_id")
|
||||
minutes String?
|
||||
points Int?
|
||||
rebounds Int?
|
||||
assists Int?
|
||||
steals Int?
|
||||
blocks Int?
|
||||
turnovers Int?
|
||||
fgMade Int? @map("fg_made")
|
||||
fgAttempted Int? @map("fg_attempted")
|
||||
threePtMade Int? @map("three_pt_made")
|
||||
threePtAttempted Int? @map("three_pt_attempted")
|
||||
ftMade Int? @map("ft_made")
|
||||
ftAttempted Int? @map("ft_attempted")
|
||||
fouls Int?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
player Player @relation(fields: [playerId], references: [id], onDelete: Cascade)
|
||||
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
id Int @id @default(autoincrement())
|
||||
matchId String @map("match_id")
|
||||
playerId String @map("player_id")
|
||||
teamId String @map("team_id")
|
||||
minutes String?
|
||||
points Int?
|
||||
rebounds Int?
|
||||
assists Int?
|
||||
steals Int?
|
||||
blocks Int?
|
||||
turnovers Int?
|
||||
fgMade Int? @map("fg_made")
|
||||
fgAttempted Int? @map("fg_attempted")
|
||||
threePtMade Int? @map("three_pt_made")
|
||||
threePtAttempted Int? @map("three_pt_attempted")
|
||||
ftMade Int? @map("ft_made")
|
||||
ftAttempted Int? @map("ft_attempted")
|
||||
fouls Int?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
player Player @relation(fields: [playerId], references: [id], onDelete: Cascade)
|
||||
team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([matchId, playerId, teamId])
|
||||
@@index([matchId])
|
||||
@@ -429,13 +430,13 @@ model OfficialRole {
|
||||
// ─────────────────────────────────────────────────────────────
|
||||
|
||||
model OddCategory {
|
||||
dbId Int @id @default(autoincrement()) @map("db_id")
|
||||
matchId String @map("match_id")
|
||||
categoryJsonId Int? @map("category_json_id")
|
||||
dbId Int @id @default(autoincrement()) @map("db_id")
|
||||
matchId String @map("match_id")
|
||||
categoryJsonId Int? @map("category_json_id")
|
||||
name String?
|
||||
sport Sport?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
selections OddSelection[]
|
||||
|
||||
@@unique([matchId, name])
|
||||
@@ -445,17 +446,17 @@ model OddCategory {
|
||||
}
|
||||
|
||||
model OddSelection {
|
||||
dbId Int @id @default(autoincrement()) @map("db_id")
|
||||
categoryId Int @map("odd_category_db_id")
|
||||
dbId Int @id @default(autoincrement()) @map("db_id")
|
||||
categoryId Int @map("odd_category_db_id")
|
||||
name String?
|
||||
oddValue String? @map("odd_value")
|
||||
oddValue String? @map("odd_value")
|
||||
position String?
|
||||
sov Float?
|
||||
state String?
|
||||
sport Sport?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @default(now()) @map("updated_at")
|
||||
category OddCategory @relation(fields: [categoryId], references: [dbId], onDelete: Cascade)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @default(now()) @map("updated_at")
|
||||
category OddCategory @relation(fields: [categoryId], references: [dbId], onDelete: Cascade)
|
||||
history OddsHistory[]
|
||||
|
||||
@@unique([categoryId, name])
|
||||
@@ -505,6 +506,29 @@ model PredictionRun {
|
||||
@@map("prediction_runs")
|
||||
}
|
||||
|
||||
model PredictionOutcome {
|
||||
id BigInt @id @default(autoincrement())
|
||||
matchId String @map("match_id")
|
||||
market String
|
||||
pick String
|
||||
probability Float
|
||||
confidence Float
|
||||
odds Float?
|
||||
playable Boolean @default(false)
|
||||
engineVersion String @map("engine_version")
|
||||
generatedAt DateTime @default(now()) @map("generated_at")
|
||||
resolved Boolean @default(false)
|
||||
hit Boolean?
|
||||
resolvedAt DateTime? @map("resolved_at")
|
||||
match Match @relation(fields: [matchId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([matchId, market, engineVersion])
|
||||
@@index([market, resolvedAt(sort: Desc)])
|
||||
@@index([resolved, generatedAt])
|
||||
@@index([playable, resolved])
|
||||
@@map("prediction_outcomes")
|
||||
}
|
||||
|
||||
model AiPredictionsLog {
|
||||
id Int @id @default(autoincrement())
|
||||
matchId String @map("match_id")
|
||||
@@ -553,20 +577,20 @@ model User {
|
||||
}
|
||||
|
||||
model Subscription {
|
||||
id String @id @default(uuid())
|
||||
userId String @unique @map("user_id")
|
||||
paddleSubscriptionId String? @unique @map("paddle_subscription_id")
|
||||
paddleCustomerId String? @map("paddle_customer_id")
|
||||
plan SubscriptionStatus @default(free)
|
||||
billingInterval BillingInterval? @map("billing_interval")
|
||||
currentPeriodStart DateTime? @map("current_period_start")
|
||||
currentPeriodEnd DateTime? @map("current_period_end")
|
||||
cancelledAt DateTime? @map("cancelled_at")
|
||||
cancelEffectiveDate DateTime? @map("cancel_effective_date")
|
||||
paddlePriceId String? @map("paddle_price_id")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
id String @id @default(uuid())
|
||||
userId String @unique @map("user_id")
|
||||
paddleSubscriptionId String? @unique @map("paddle_subscription_id")
|
||||
paddleCustomerId String? @map("paddle_customer_id")
|
||||
plan SubscriptionStatus @default(free)
|
||||
billingInterval BillingInterval? @map("billing_interval")
|
||||
currentPeriodStart DateTime? @map("current_period_start")
|
||||
currentPeriodEnd DateTime? @map("current_period_end")
|
||||
cancelledAt DateTime? @map("cancelled_at")
|
||||
cancelEffectiveDate DateTime? @map("cancel_effective_date")
|
||||
paddlePriceId String? @map("paddle_price_id")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([paddleSubscriptionId])
|
||||
@@index([paddleCustomerId])
|
||||
|
||||
Reference in New Issue
Block a user