metaforecast/prisma/schema.prisma

90 lines
2.1 KiB
Plaintext
Raw Normal View History

2022-03-27 22:22:28 +00:00
generator client {
provider = "prisma-client-js"
previewFeatures = ["interactiveTransactions"]
2022-03-27 22:22:28 +00:00
}
generator pothos {
provider = "prisma-pothos-types"
}
2022-03-27 22:22:28 +00:00
datasource db {
provider = "postgresql"
url = env("DIGITALOCEAN_POSTGRES")
}
2022-04-05 20:38:40 +00:00
model Dashboard {
2022-04-05 20:38:40 +00:00
id String @id
title String
description String
contents Json
timestamp DateTime @db.Timestamp(6)
creator String
extra Json
@@map("dashboards")
2022-04-05 20:38:40 +00:00
}
model History {
2022-04-05 20:38:40 +00:00
id String
idref String?
question Question? @relation(fields: [idref], references: [id], onDelete: SetNull, onUpdate: Restrict)
2022-04-05 20:38:40 +00:00
title String
url String
platform String
description String
options Json
timestamp DateTime @db.Timestamp(6)
2022-04-05 20:38:40 +00:00
qualityindicators Json
extra Json
pk Int @id @default(autoincrement())
2022-04-05 20:38:40 +00:00
@@index([id])
@@map("history")
2022-04-05 20:38:40 +00:00
}
model Question {
/// E.g. "fantasyscotus-580"
id String @id
/// E.g. "In Wooden v. U.S., the SCOTUS will affirm the lower court's decision"
title String
/// E.g. "https://fantasyscotus.net/user-predictions/case/wooden-v-us/"
url String
/// E.g. "fantasyscotus"
platform String
/// E.g. "62.50% (75 out of 120) of FantasySCOTUS players predict that the lower court's decision will be affirmed. FantasySCOTUS overall predicts an outcome of Affirm 6-3. Historically, FantasySCOTUS has chosen the correct side 50.00% of the time."
description String
// E.g.:
// [
// {
// "name": "Yes",
// "probability": 0.625,
// "type": "PROBABILITY"
// },
// {
// "name": "No",
// "probability": 0.375,
// "type": "PROBABILITY"
// }
// ]
options Json
timestamp DateTime @db.Timestamp(6)
// {
// "numforecasts": 120,
// "stars": 2
// }
2022-04-05 20:38:40 +00:00
qualityindicators Json
extra Json
onFrontpage FrontpageId?
history History[]
@@map("questions")
2022-04-05 20:38:40 +00:00
}
model FrontpageId {
question Question @relation(fields: [id], references: [id])
id String @unique
}