mirror of
https://github.com/SrIzan10/fireentity-movienights.git
synced 2026-06-06 00:56:52 +00:00
106 lines
2.6 KiB
Plaintext
106 lines
2.6 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String
|
|
email String @unique
|
|
image String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
isAdmin Boolean @default(false)
|
|
accounts Account[]
|
|
sessions Session[]
|
|
votes Vote[]
|
|
emailVerified Boolean
|
|
|
|
@@map("user")
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
expiresAt DateTime
|
|
token String @unique
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
ipAddress String?
|
|
userAgent String?
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@map("session")
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
accountId String
|
|
providerId String
|
|
userId String
|
|
accessToken String?
|
|
refreshToken String?
|
|
idToken String?
|
|
accessTokenExpiresAt DateTime?
|
|
refreshTokenExpiresAt DateTime?
|
|
scope String?
|
|
password String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([providerId, accountId])
|
|
@@map("account")
|
|
}
|
|
|
|
model Verification {
|
|
id String @id @default(cuid())
|
|
identifier String
|
|
value String
|
|
expiresAt DateTime
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
@@unique([identifier, value])
|
|
@@map("verification")
|
|
}
|
|
|
|
model Movie {
|
|
id String @id @default(cuid())
|
|
title String
|
|
description String
|
|
posterUrl String
|
|
suggestedBy String
|
|
approved Boolean @default(false)
|
|
votes Vote[]
|
|
schedules MovieSchedule[]
|
|
}
|
|
|
|
model MovieSchedule {
|
|
id String @id @default(cuid())
|
|
movieId String
|
|
date DateTime
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
movie Movie @relation(fields: [movieId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([movieId, date])
|
|
}
|
|
|
|
model Vote {
|
|
id String @id @default(cuid())
|
|
movieId String
|
|
userId String
|
|
movie Movie @relation(fields: [movieId], references: [id], onDelete: Cascade)
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([movieId, userId])
|
|
}
|