mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
466 lines
16 KiB
Text
466 lines
16 KiB
Text
generator client {
|
|
provider = "prisma-client-js"
|
|
previewFeatures = ["typedSql"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Album_Animation {
|
|
albumId Int
|
|
animationId Int
|
|
album albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Animation_ibfk_1")
|
|
animation animation @relation(fields: [animationId], references: [id], onDelete: Cascade, map: "Album_Animation_ibfk_2")
|
|
|
|
@@id([albumId, animationId])
|
|
}
|
|
|
|
model Album_Artist {
|
|
albumId Int
|
|
artistSlug String @db.VarChar(255)
|
|
album albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Artist_ibfk_1")
|
|
artist artist @relation(fields: [artistSlug], references: [slug], onDelete: Cascade, map: "Album_Artist_ibfk_2")
|
|
|
|
@@id([albumId, artistSlug])
|
|
}
|
|
|
|
model Album_Category {
|
|
categoryName String @db.VarChar(255)
|
|
albumId Int
|
|
category category @relation(fields: [categoryName], references: [name], onDelete: Cascade, map: "Album_Category_ibfk_1")
|
|
albums albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Category_ibfk_2")
|
|
|
|
@@id([categoryName, albumId])
|
|
}
|
|
|
|
model Album_Classification {
|
|
albumId Int
|
|
classificationName String @db.VarChar(255)
|
|
album albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Classification_ibfk_1")
|
|
classification classification @relation(fields: [classificationName], references: [name], onDelete: Cascade, map: "Album_Classification_ibfk_2")
|
|
|
|
@@id([albumId, classificationName])
|
|
}
|
|
|
|
model Album_Game {
|
|
gameSlug String @db.VarChar(255)
|
|
albumId Int
|
|
game game @relation(fields: [gameSlug], references: [slug], onDelete: Cascade, map: "Album_Game_ibfk_1")
|
|
album albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Game_ibfk_2")
|
|
|
|
@@id([gameSlug, albumId])
|
|
}
|
|
|
|
model Album_Platform {
|
|
albumId Int
|
|
platformId Int
|
|
album albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Platform_ibfk_1")
|
|
platform platform @relation(fields: [platformId], references: [id], onDelete: Cascade, map: "Album_Platform_ibfk_2")
|
|
|
|
@@id([albumId, platformId])
|
|
}
|
|
|
|
model Game_Platform {
|
|
gameSlug String @db.VarChar(255)
|
|
platformId Int
|
|
game game @relation(fields: [gameSlug], references: [slug], onDelete: Cascade, map: "Game_Platform_ibfk_1")
|
|
platform platform @relation(fields: [platformId], references: [id], onDelete: Cascade, map: "Game_Platform_ibfk_2")
|
|
|
|
@@id([gameSlug, platformId])
|
|
}
|
|
|
|
model Publisher_Game {
|
|
gameSlug String @db.VarChar(255)
|
|
publisherId Int
|
|
game game @relation(fields: [gameSlug], references: [slug], onDelete: Cascade, map: "Publisher_Game_ibfk_1")
|
|
publisher publisher @relation(fields: [publisherId], references: [id], onDelete: Cascade, map: "Publisher_Game_ibfk_2")
|
|
|
|
@@id([gameSlug, publisherId])
|
|
}
|
|
|
|
model Series_Game {
|
|
gameSlug String @db.VarChar(255)
|
|
seriesSlug String @db.VarChar(255)
|
|
game game @relation(fields: [gameSlug], references: [slug], onDelete: Cascade, map: "Series_Game_ibfk_1")
|
|
series series @relation(fields: [seriesSlug], references: [slug], onDelete: Cascade, map: "Series_Game_ibfk_2")
|
|
|
|
@@id([gameSlug, seriesSlug])
|
|
}
|
|
|
|
model Studio_Animation {
|
|
animationId Int
|
|
studioSlug String @db.VarChar(255)
|
|
animation animation @relation(fields: [animationId], references: [id], onDelete: Cascade, map: "Studio_Animation_ibfk_1")
|
|
studio studio @relation(fields: [studioSlug], references: [slug], onDelete: Cascade, map: "Studio_Animation_ibfk_2")
|
|
|
|
@@id([animationId, studioSlug])
|
|
}
|
|
|
|
model User_Role {
|
|
userUsername String @db.VarChar(255)
|
|
roleName String @db.VarChar(255)
|
|
users users @relation(fields: [userUsername], references: [id], onDelete: Cascade, map: "User_Role_ibfk_1")
|
|
roles roles @relation(fields: [roleName], references: [name], onDelete: Cascade, map: "User_Role_ibfk_2")
|
|
|
|
@@id([userUsername, roleName])
|
|
}
|
|
|
|
model albumHistories {
|
|
id Int @id @default(autoincrement())
|
|
updatedData Json?
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
username String? @db.VarChar(255)
|
|
albumId Int?
|
|
user users? @relation(fields: [username], references: [id], map: "albumHistories_ibfk_1")
|
|
album albums? @relation(fields: [albumId], references: [id], map: "albumHistories_ibfk_2")
|
|
}
|
|
|
|
enum AlbumStatus {
|
|
SHOW @map("Show")
|
|
HIDDEN @map("Hidden")
|
|
}
|
|
|
|
model albums {
|
|
id Int @id @default(autoincrement())
|
|
title String? @db.VarChar(255)
|
|
subTitle String? @db.Text
|
|
releaseDate DateTime? @db.Date
|
|
label String? @db.VarChar(255)
|
|
vgmdb String? @db.VarChar(255)
|
|
createdAt DateTime @default(now()) @db.DateTime(0)
|
|
updatedAt DateTime @default(now()) @db.DateTime(0)
|
|
publishedAt DateTime @default(now())
|
|
description String? @db.VarChar(255)
|
|
createdBy String? @db.VarChar(255)
|
|
status AlbumStatus @default(HIDDEN)
|
|
headerColor String @default("#ffffff") @db.VarChar(255)
|
|
animations Album_Animation[]
|
|
artists Album_Artist[]
|
|
categories Album_Category[]
|
|
classifications Album_Classification[]
|
|
games Album_Game[]
|
|
platforms Album_Platform[]
|
|
histories albumHistories[]
|
|
comments comments[]
|
|
discs discs[]
|
|
downloads downloads[]
|
|
favorites favorites[]
|
|
linkCategories linkCategories[]
|
|
ratings ratings[]
|
|
relatedAlbums related_album[] @relation("related_album_albumIdToalbums")
|
|
relatedTo related_album[] @relation("related_album_relatedIdToalbums")
|
|
stores stores[]
|
|
|
|
@@fulltext([title, subTitle])
|
|
}
|
|
|
|
model animation {
|
|
id Int @id @default(autoincrement())
|
|
title String? @unique(map: "title") @db.VarChar(255)
|
|
releaseDate DateTime? @db.Date
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
studioSlug String? @db.VarChar(255)
|
|
subTitle String? @unique(map: "subTitle") @db.VarChar(255)
|
|
placeholder String? @db.Text
|
|
headerColor String? @default("#ffffff") @db.VarChar(255)
|
|
albums Album_Animation[]
|
|
studios Studio_Animation[]
|
|
}
|
|
|
|
model artist {
|
|
slug String @id @db.VarChar(255)
|
|
name String? @db.VarChar(255)
|
|
albums Album_Artist[]
|
|
}
|
|
|
|
model category {
|
|
name String @id @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
albums Album_Category[]
|
|
}
|
|
|
|
model classification {
|
|
name String @id @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
classifications Album_Classification[]
|
|
}
|
|
|
|
model comments {
|
|
id Int @id @default(autoincrement())
|
|
text String? @db.VarChar(300)
|
|
anon Boolean?
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
albumId Int?
|
|
username String? @db.VarChar(255)
|
|
album albums? @relation(fields: [albumId], references: [id], map: "comments_ibfk_1")
|
|
user users? @relation(fields: [username], references: [id], map: "comments_ibfk_2")
|
|
}
|
|
|
|
model config {
|
|
name String @id @db.VarChar(255)
|
|
value String? @default("") @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
}
|
|
|
|
model discs {
|
|
id Int @id @default(autoincrement())
|
|
number Int?
|
|
body String? @db.Text
|
|
albumId Int
|
|
album albums? @relation(fields: [albumId], references: [id], map: "discs_ibfk_1")
|
|
}
|
|
|
|
model downloads {
|
|
id Int @id @default(autoincrement())
|
|
title String? @db.VarChar(255)
|
|
albumId Int
|
|
album albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "downloads_ibfk_1")
|
|
links links[]
|
|
}
|
|
|
|
model favorites {
|
|
id Int @id @default(autoincrement())
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
albumId Int
|
|
username String? @db.VarChar(255)
|
|
album albums? @relation(fields: [albumId], references: [id], map: "favorites_ibfk_1")
|
|
users users? @relation(fields: [username], references: [id], map: "favorites_ibfk_2")
|
|
}
|
|
|
|
model forgors {
|
|
id Int @id @default(autoincrement())
|
|
expires DateTime? @db.DateTime(0)
|
|
key String? @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
username String? @db.VarChar(255)
|
|
user users? @relation(fields: [username], references: [id], map: "forgors_ibfk_1")
|
|
}
|
|
|
|
model game {
|
|
slug String @id @db.VarChar(255)
|
|
name String? @db.VarChar(255)
|
|
releaseDate DateTime? @db.Date
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
placeholder String? @db.Text
|
|
headerColor String? @default("#ffffff") @db.VarChar(255)
|
|
albums Album_Game[]
|
|
platforms Game_Platform[]
|
|
publishers Publisher_Game[]
|
|
series Series_Game[]
|
|
}
|
|
|
|
model linkCategories {
|
|
id Int @id @default(autoincrement())
|
|
title String? @db.VarChar(255)
|
|
small Boolean?
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
albumId Int
|
|
album albums? @relation(fields: [albumId], references: [id], map: "linkCategories_ibfk_1")
|
|
}
|
|
|
|
model links {
|
|
id Int @id @default(autoincrement())
|
|
url String? @db.VarChar(255)
|
|
directUrl String? @db.VarChar(255)
|
|
provider String? @db.VarChar(255)
|
|
custom String? @db.VarChar(255)
|
|
downloadId Int
|
|
url2 String? @db.VarChar(255)
|
|
download downloads? @relation(fields: [downloadId], references: [id], map: "links_ibfk_1")
|
|
}
|
|
|
|
model logs {
|
|
id Int @id @default(autoincrement())
|
|
action String? @db.VarChar(255)
|
|
data String? @db.Text
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
username String? @db.VarChar(255)
|
|
user users? @relation(fields: [username], references: [id], map: "logs_ibfk_1")
|
|
}
|
|
|
|
model pendings {
|
|
id Int @id
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
}
|
|
|
|
model platform {
|
|
id Int @id @default(autoincrement())
|
|
name String? @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
type String? @default("Game") @db.VarChar(255)
|
|
albums Album_Platform[]
|
|
games Game_Platform[]
|
|
}
|
|
|
|
model publisher {
|
|
id Int @id @default(autoincrement())
|
|
name String? @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
games Publisher_Game[]
|
|
}
|
|
|
|
model ratings {
|
|
id Int @id @default(autoincrement())
|
|
score Int
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
albumId Int
|
|
username String @db.VarChar(255)
|
|
album albums? @relation(fields: [albumId], references: [id], map: "ratings_ibfk_1")
|
|
user users? @relation(fields: [username], references: [id], map: "ratings_ibfk_2")
|
|
}
|
|
|
|
model related_album {
|
|
albumId Int
|
|
relatedId Int
|
|
pageAlbum albums @relation("related_album_albumIdToalbums", fields: [albumId], references: [id], onDelete: Cascade, map: "related_album_ibfk_1")
|
|
relatedAlbum albums @relation("related_album_relatedIdToalbums", fields: [relatedId], references: [id], onDelete: Cascade, map: "related_album_ibfk_2")
|
|
|
|
@@id([albumId, relatedId])
|
|
}
|
|
|
|
model requests {
|
|
id Int @id @default(autoincrement())
|
|
title String? @db.VarChar(255)
|
|
link String? @db.VarChar(255)
|
|
user String? @db.VarChar(255)
|
|
userID String? @db.VarChar(255)
|
|
state String @db.VarChar(255)
|
|
donator Boolean
|
|
reason String? @db.VarChar(255)
|
|
comments String? @db.VarChar(255)
|
|
message String? @db.VarChar(255)
|
|
createdAt DateTime @default(now()) @db.DateTime(0)
|
|
updatedAt DateTime @default(now()) @db.DateTime(0)
|
|
submissions submissions[]
|
|
}
|
|
|
|
model roles {
|
|
name String @id @db.VarChar(255)
|
|
permissions Json?
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
users User_Role[]
|
|
}
|
|
|
|
model series {
|
|
slug String @id @db.VarChar(255)
|
|
name String? @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
placeholder String? @db.Text
|
|
headerColor String? @default("#ffffff") @db.VarChar(255)
|
|
games Series_Game[]
|
|
}
|
|
|
|
model stores {
|
|
id Int @id @default(autoincrement())
|
|
url String? @db.VarChar(255)
|
|
provider String? @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
albumId Int?
|
|
album albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "stores_ibfk_1")
|
|
}
|
|
|
|
model studio {
|
|
slug String @id @db.VarChar(255)
|
|
name String? @db.VarChar(255)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
animations Studio_Animation[]
|
|
}
|
|
|
|
model submissions {
|
|
id Int @id @default(autoincrement())
|
|
state String? @default("pending") @db.VarChar(255)
|
|
title String? @db.VarChar(255)
|
|
vgmdb String? @db.VarChar(255)
|
|
links String? @db.Text
|
|
score Int? @default(0)
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
userUsername String? @db.VarChar(255)
|
|
requestId Int?
|
|
user users? @relation(fields: [userUsername], references: [id], map: "submissions_ibfk_1")
|
|
request requests? @relation(fields: [requestId], references: [id], map: "submissions_ibfk_2")
|
|
}
|
|
|
|
model users {
|
|
id String @id @db.VarChar(255)
|
|
name String @db.VarChar(20)
|
|
username String @unique @db.VarChar(255)
|
|
displayUsername String @default("Default display name")
|
|
email String? @unique @db.VarChar(255)
|
|
emailVerified Boolean
|
|
createdAt DateTime @db.DateTime(0)
|
|
updatedAt DateTime @db.DateTime(0)
|
|
image String? @db.VarChar(255)
|
|
|
|
roles User_Role[]
|
|
histories albumHistories[]
|
|
comments comments[]
|
|
favorites favorites[]
|
|
forgors forgors[]
|
|
logs logs[]
|
|
ratings ratings[]
|
|
submissions submissions[]
|
|
sessions session[]
|
|
accounts account[]
|
|
}
|
|
|
|
model session {
|
|
id String @id
|
|
userId String @db.VarChar(255)
|
|
token String @unique
|
|
expiresAt DateTime
|
|
ipAddress String?
|
|
userAgent String?
|
|
createdAt DateTime
|
|
updatedAt DateTime
|
|
|
|
user users @relation(fields: [userId], references: [id])
|
|
}
|
|
|
|
model verification {
|
|
id String @id
|
|
identifier String
|
|
value String @db.Text
|
|
expiresAt DateTime
|
|
createdAt DateTime
|
|
updatedAt DateTime
|
|
}
|
|
|
|
model account {
|
|
id String @id
|
|
userId String
|
|
accountId String
|
|
providerId String
|
|
accessToken String?
|
|
refreshToken String?
|
|
accessTokenExpiresAt DateTime?
|
|
refreshTokenExpiresAt DateTime?
|
|
scope String?
|
|
idToken String?
|
|
password String?
|
|
createdAt DateTime
|
|
updatedAt DateTime
|
|
|
|
user users @relation(fields: [userId], references: [id])
|
|
}
|