2023-12-30 05:56:40 -05:00
|
|
|
generator client {
|
|
|
|
provider = "prisma-client-js"
|
|
|
|
}
|
|
|
|
|
|
|
|
datasource db {
|
|
|
|
provider = "mysql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
relationMode = "prisma"
|
|
|
|
}
|
|
|
|
|
2024-01-04 03:56:24 -05:00
|
|
|
enum UserRole {
|
|
|
|
USER
|
|
|
|
ADMIN
|
|
|
|
}
|
|
|
|
|
2023-12-30 05:56:40 -05:00
|
|
|
model User {
|
2024-01-02 02:26:20 -05:00
|
|
|
id String @id @default(cuid())
|
|
|
|
name String?
|
|
|
|
email String? @unique
|
|
|
|
emailVerified DateTime?
|
2024-01-04 03:56:24 -05:00
|
|
|
role UserRole @default(USER)
|
2024-01-02 02:26:20 -05:00
|
|
|
image String?
|
2024-01-04 02:14:11 -05:00
|
|
|
ttsDefaultVoice Int @default(1)
|
|
|
|
ttsEnabledVoice Int @default(1048575)
|
2023-12-30 05:56:40 -05:00
|
|
|
|
|
|
|
apiKeys ApiKey[]
|
2024-01-02 02:26:20 -05:00
|
|
|
accounts Account[]
|
2023-12-30 05:56:40 -05:00
|
|
|
twitchConnections TwitchConnection[]
|
2024-01-02 13:00:11 -05:00
|
|
|
ttsUsernameFilter TtsUsernameFilter[]
|
|
|
|
ttsWordFilter TtsWordFilter[]
|
2023-12-30 05:56:40 -05:00
|
|
|
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
updatedAt DateTime @updatedAt
|
|
|
|
}
|
|
|
|
|
2024-01-02 02:26:20 -05:00
|
|
|
model Account {
|
|
|
|
id String @id @default(cuid())
|
|
|
|
userId String
|
|
|
|
type String
|
|
|
|
provider String
|
|
|
|
providerAccountId String
|
|
|
|
refresh_token String? @db.Text
|
|
|
|
access_token String? @db.Text
|
|
|
|
expires_at Int?
|
|
|
|
token_type String?
|
|
|
|
scope String?
|
|
|
|
id_token String? @db.Text
|
|
|
|
session_state String?
|
|
|
|
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
|
|
|
|
@@unique([provider, providerAccountId])
|
|
|
|
}
|
|
|
|
|
2023-12-30 05:56:40 -05:00
|
|
|
model ApiKey {
|
|
|
|
id String @id @default(uuid())
|
|
|
|
label String
|
|
|
|
|
|
|
|
userId String
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
}
|
|
|
|
|
|
|
|
model TwitchConnection {
|
|
|
|
broadcasterId String @unique
|
|
|
|
accessToken String
|
|
|
|
refreshToken String
|
|
|
|
|
|
|
|
userId String @id
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
|
|
|
|
@@index([userId])
|
|
|
|
}
|
|
|
|
|
|
|
|
model TtsUsernameFilter {
|
|
|
|
username String
|
2024-01-02 02:26:20 -05:00
|
|
|
tag String
|
2023-12-30 05:56:40 -05:00
|
|
|
|
2024-01-02 13:00:11 -05:00
|
|
|
userId String
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2023-12-30 05:56:40 -05:00
|
|
|
|
2024-01-02 13:00:11 -05:00
|
|
|
@@index([userId])
|
|
|
|
@@id([userId, username])
|
2023-12-30 05:56:40 -05:00
|
|
|
}
|
|
|
|
|
2024-01-02 13:00:11 -05:00
|
|
|
model TtsWordFilter {
|
2024-01-04 02:14:11 -05:00
|
|
|
id String @id @default(cuid())
|
2024-01-02 13:00:11 -05:00
|
|
|
search String
|
2023-12-30 05:56:40 -05:00
|
|
|
replace String
|
|
|
|
|
2024-01-02 13:00:11 -05:00
|
|
|
userId String
|
2024-01-04 02:14:11 -05:00
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
2023-12-30 05:56:40 -05:00
|
|
|
|
2024-01-02 13:00:11 -05:00
|
|
|
@@index([userId])
|
2024-01-04 02:14:11 -05:00
|
|
|
@@unique([userId, search])
|
2024-01-02 13:00:11 -05:00
|
|
|
}
|