Some changes on prisma

This commit is contained in:
2026-01-11 12:05:24 +01:00
parent 9fc94f342b
commit 554272d83f
4 changed files with 116 additions and 80 deletions

View File

@ -13,6 +13,8 @@ datasource db {
provider = "postgresql"
}
/** Artworks **/
model Artwork {
id String @id @default(cuid())
createdAt DateTime @default(now())
@ -231,6 +233,7 @@ model FileVariant {
@@unique([artworkId, type])
}
/** Commissions **/
model Commission {
id String @id @default(cuid())
createdAt DateTime @default(now())
@ -411,6 +414,39 @@ model TermsOfService {
version Int @default(autoincrement())
}
/** Voting **/
model Animal {
id String @id @default(cuid())
name String
slug String @unique
description String?
imageUrl String?
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
votes Vote[]
}
model Vote {
id String @id @default(cuid())
animalId String
voterId String? // Twitch user ID (nullable for anon)
source VoteSource
createdAt DateTime @default(now())
animal Animal @relation(fields: [animalId], references: [id])
@@index([animalId])
}
enum VoteSource {
TWITCH_CHAT
CHANNEL_POINTS
ADMIN
}
/** User management **/
model User {
id String @id
name String