generator client { provider = "prisma-client-js" } datasource db { provider = "mysql" url = env("DATABASE_URL") relationMode = "prisma" } enum UserRole { USER ADMIN } model User { id String @id @default(cuid()) name String? email String? @unique emailVerified DateTime? role UserRole @default(USER) image String? ttsDefaultVoice Int @default(1) ttsEnabledVoice Int @default(1048575) impersonationSources Impersonation[] @relation(name: "impersonationSources") impersonationTargets Impersonation[] @relation(name: "impersonationTargets") apiKeys ApiKey[] accounts Account[] twitchConnections TwitchConnection[] ttsUsernameFilter TtsUsernameFilter[] ttsWordFilter TtsWordFilter[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } 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]) @@index([userId]) } model Impersonation { sourceId String targetId String source User @relation(name: "impersonationSources", fields: [sourceId], references: [id], onDelete: Cascade) target User @relation(name: "impersonationTargets", fields: [targetId], references: [id], onDelete: Cascade) @@id([sourceId]) @@index([sourceId]) @@index([targetId]) } 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 tag String userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@index([userId]) @@id([userId, username]) } model TtsWordFilter { id String @id @default(cuid()) search String replace String userId String user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@index([userId]) @@unique([userId, search]) }