98 lines
2.9 KiB
Plaintext
98 lines
2.9 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "./generated"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("POSTGRES_URI")
|
|
}
|
|
|
|
model Stream {
|
|
id String @id @default(uuid())
|
|
title String
|
|
thumbnailUrl String? @map("thumbnail_url")
|
|
ingressId String? @unique @map("ingress_id")
|
|
serverUrl String? @map("server_url")
|
|
key String? @map("key")
|
|
isLive Boolean @default(false) @map("is_live")
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String? @unique @map("user_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
category Category? @relation(fields: [categoryId], references: [id], onDelete: Cascade)
|
|
categoryId String? @map("category_id")
|
|
|
|
@@map("stream")
|
|
}
|
|
|
|
model SocialLink {
|
|
id String @id @default(uuid())
|
|
title String
|
|
url String
|
|
position Int
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String? @map("user_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@map("social_links")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
password String
|
|
name String @unique
|
|
displayName String @map("display_name")
|
|
avatar String?
|
|
bio String?
|
|
token Token[]
|
|
isVerified Boolean @default(false) @map("is_verified")
|
|
isEmailVerified Boolean @default(false) @map("is_email_verified")
|
|
isTotpEnabled Boolean @default(false) @map("is_totp_enabled")
|
|
isDeactivated Boolean @default(false) @map("is_deactivated")
|
|
deactivatedAt DateTime? @map("deactivated_at")
|
|
socialLink SocialLink[]
|
|
totpSecret String? @map("totp_secret")
|
|
stream Stream?
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@map("users")
|
|
}
|
|
|
|
model Category {
|
|
id String @id @default(uuid())
|
|
title String
|
|
slug String @unique
|
|
description String?
|
|
thumbnailUrl String @map("thumbnail_url")
|
|
streams Stream[]
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@map("categories")
|
|
}
|
|
|
|
model Token {
|
|
id String @id @default(uuid())
|
|
token String @unique
|
|
type TokenType
|
|
expiresIn DateTime @map("expires_in")
|
|
user User? @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
userId String? @map("user_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@map("tokens")
|
|
}
|
|
|
|
enum TokenType {
|
|
EMAIL_VERIFY
|
|
PASSWORD_RESET
|
|
DEACTIVATE_ACCOUNT
|
|
|
|
@@map("token_types")
|
|
}
|