pollo/prisma/schema.prisma

51 lines
1.1 KiB
Text
Raw Normal View History

2023-04-20 04:20:00 -06:00
generator client {
2023-07-11 17:30:40 -06:00
provider = "prisma-client-js"
2023-04-20 04:20:00 -06:00
}
datasource db {
2023-07-26 23:55:48 -06:00
provider = "mysql"
2023-07-11 17:30:40 -06:00
url = env("DATABASE_URL")
2023-07-26 23:55:48 -06:00
relationMode = "prisma"
2023-04-20 04:20:00 -06:00
}
model Room {
2023-07-11 17:30:40 -06:00
id String @id @unique @default(cuid())
createdAt DateTime @default(now())
userId String
roomName String
storyName String
visible Boolean
votes Vote[]
scale String
logs Log[]
2023-04-20 04:20:00 -06:00
2023-07-11 17:30:40 -06:00
@@index([userId])
2023-04-20 04:20:00 -06:00
}
model Vote {
2023-07-11 17:30:40 -06:00
id String @id @unique @default(cuid())
createdAt DateTime @default(now())
userId String
roomId String
value String
room Room @relation(fields: [roomId], references: [id], onDelete: Cascade)
@@unique([userId, roomId])
@@index([roomId])
2023-04-20 04:20:00 -06:00
}
model Log {
2023-07-11 17:30:40 -06:00
id String @id @unique @default(cuid())
createdAt DateTime @default(now())
userId String
roomId String
scale String
votes Json
roomName String
storyName String
room Room @relation(fields: [roomId], references: [id], onDelete: Cascade)
2023-04-20 04:20:00 -06:00
2023-07-11 17:30:40 -06:00
@@index([userId])
@@index([roomId])
2023-04-20 04:20:00 -06:00
}