mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Cleanup relation schema
This commit is contained in:
parent
781a9ae216
commit
a8d253fa2e
10 changed files with 404 additions and 291 deletions
|
|
@ -0,0 +1,183 @@
|
|||
/*
|
||||
- Made the column `albumId` on table `discs` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `albumId` on table `downloads` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `albumId` on table `favorites` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `albumId` on table `linkCategories` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `downloadId` on table `links` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `score` on table `ratings` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `albumId` on table `ratings` required. This step will fail if there are existing NULL values in that column.
|
||||
- Made the column `username` on table `ratings` required. This step will fail if there are existing NULL values in that column.
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `animation` DROP FOREIGN KEY `animation_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `discs` DROP FOREIGN KEY `discs_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `downloads` DROP FOREIGN KEY `downloads_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `favorites` DROP FOREIGN KEY `favorites_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `linkCategories` DROP FOREIGN KEY `linkCategories_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `links` DROP FOREIGN KEY `links_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `logs` DROP FOREIGN KEY `logs_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `ratings` DROP FOREIGN KEY `ratings_ibfk_1`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `ratings` DROP FOREIGN KEY `ratings_ibfk_2`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `studioSlug` ON `animation`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `ostId` ON `discs`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `ostId` ON `downloads`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `ostId` ON `favorites`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `ostId` ON `linkCategories`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `downloadId` ON `links`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `username` ON `logs`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `ostId` ON `ratings`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `username` ON `ratings`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Animation` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Artist` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Category` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Classification` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Game` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Platform` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Album_Type` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Game_Platform` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Publisher_Game` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Series_Game` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Studio_Animation` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `User_Role` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
DELETE FROM `discs` WHERE `albumId` IS NULL;
|
||||
ALTER TABLE `discs` MODIFY `albumId` INTEGER NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
DELETE FROM `downloads` WHERE `albumId` IS NULL;
|
||||
ALTER TABLE `downloads` MODIFY `albumId` INTEGER NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
DELETE FROM `favorites` WHERE `albumId` IS NULL;
|
||||
ALTER TABLE `favorites` MODIFY `albumId` INTEGER NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
DELETE FROM `linkCategories` WHERE `albumId` IS NULL;
|
||||
ALTER TABLE `linkCategories` MODIFY `albumId` INTEGER NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
DELETE FROM `links` WHERE `downloadId` IS NULL;
|
||||
ALTER TABLE `links` MODIFY `downloadId` INTEGER NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
DELETE FROM `ratings`
|
||||
WHERE `score` IS NULL
|
||||
OR `albumId` IS NULL
|
||||
OR `username` IS NULL;
|
||||
ALTER TABLE `ratings`
|
||||
MODIFY `score` INTEGER NOT NULL,
|
||||
MODIFY `albumId` INTEGER NOT NULL,
|
||||
MODIFY `username` VARCHAR(255) NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `related_album` DROP COLUMN `createdAt`,
|
||||
DROP COLUMN `updatedAt`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `type`
|
||||
DROP COLUMN `updatedAt`,
|
||||
DROP COLUMN `createdAt`,
|
||||
MODIFY `name` VARCHAR(255) NOT NULL;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE `SequelizeMeta`;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `discs` ADD CONSTRAINT `discs_ibfk_1` FOREIGN KEY (`albumId`) REFERENCES `albums`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `downloads` ADD CONSTRAINT `downloads_ibfk_1` FOREIGN KEY (`albumId`) REFERENCES `albums`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `favorites` ADD CONSTRAINT `favorites_ibfk_1` FOREIGN KEY (`albumId`) REFERENCES `albums`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `linkCategories` ADD CONSTRAINT `linkCategories_ibfk_1` FOREIGN KEY (`albumId`) REFERENCES `albums`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `links` ADD CONSTRAINT `links_ibfk_1` FOREIGN KEY (`downloadId`) REFERENCES `downloads`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `logs` ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`username`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `ratings` ADD CONSTRAINT `ratings_ibfk_1` FOREIGN KEY (`albumId`) REFERENCES `albums`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `ratings` ADD CONSTRAINT `ratings_ibfk_2` FOREIGN KEY (`username`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `logs` DROP FOREIGN KEY `logs_ibfk_1`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `logs_ibfk_1` ON `logs`;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `logs` ADD CONSTRAINT `logs_ibfk_1` FOREIGN KEY (`username`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
@ -9,151 +9,111 @@ datasource db {
|
|||
}
|
||||
|
||||
model Album_Animation {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int
|
||||
animationId Int
|
||||
albums albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Animation_ibfk_1")
|
||||
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])
|
||||
@@index([animationId], map: "animationId")
|
||||
}
|
||||
|
||||
model Album_Artist {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int
|
||||
artistSlug String @db.VarChar(255)
|
||||
albums 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")
|
||||
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])
|
||||
@@index([artistSlug], map: "artistSlug")
|
||||
}
|
||||
|
||||
model Album_Category {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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])
|
||||
@@index([albumId], map: "ostId")
|
||||
}
|
||||
|
||||
model Album_Classification {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int
|
||||
classificationName String @db.VarChar(255)
|
||||
albums albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Classification_ibfk_1")
|
||||
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])
|
||||
@@index([classificationName], map: "categoryName")
|
||||
}
|
||||
|
||||
model Album_Game {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
gameSlug String @db.VarChar(255)
|
||||
albumId Int
|
||||
game game @relation(fields: [gameSlug], references: [slug], onDelete: Cascade, map: "Album_Game_ibfk_1")
|
||||
albums albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Game_ibfk_2")
|
||||
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])
|
||||
@@index([albumId], map: "ostId")
|
||||
}
|
||||
|
||||
model Album_Platform {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int
|
||||
platformId Int
|
||||
albums albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Platform_ibfk_1")
|
||||
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])
|
||||
@@index([platformId], map: "platformId")
|
||||
}
|
||||
|
||||
model Album_Type {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int
|
||||
typeId Int
|
||||
albums albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Type_ibfk_1")
|
||||
type type @relation(fields: [typeId], references: [id], onDelete: Cascade, map: "Album_Type_ibfk_2")
|
||||
albumId Int
|
||||
typeId Int
|
||||
album albums @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "Album_Type_ibfk_1")
|
||||
type type @relation(fields: [typeId], references: [id], onDelete: Cascade, map: "Album_Type_ibfk_2")
|
||||
|
||||
@@id([albumId, typeId])
|
||||
@@index([typeId], map: "typeId")
|
||||
}
|
||||
|
||||
model Game_Platform {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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])
|
||||
@@index([platformId], map: "platformId")
|
||||
}
|
||||
|
||||
model Publisher_Game {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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])
|
||||
@@index([publisherId], map: "publisherId")
|
||||
}
|
||||
|
||||
model SequelizeMeta {
|
||||
name String @id @unique(map: "name") @db.VarChar(255)
|
||||
}
|
||||
|
||||
model Series_Game {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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")
|
||||
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])
|
||||
@@index([seriesSlug], map: "seriesSlug")
|
||||
}
|
||||
|
||||
model Studio_Animation {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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])
|
||||
@@index([studioSlug], map: "studioSlug")
|
||||
}
|
||||
|
||||
model User_Role {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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")
|
||||
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])
|
||||
@@index([roleName], map: "roleName")
|
||||
}
|
||||
|
||||
model albumHistories {
|
||||
|
|
@ -163,70 +123,64 @@ model albumHistories {
|
|||
updatedAt DateTime @db.DateTime(0)
|
||||
username String? @db.VarChar(255)
|
||||
albumId Int?
|
||||
users users? @relation(fields: [username], references: [id], map: "albumHistories_ibfk_1")
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "albumHistories_ibfk_2")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
@@index([username], map: "username")
|
||||
user users? @relation(fields: [username], references: [id], map: "albumHistories_ibfk_1")
|
||||
album albums? @relation(fields: [albumId], references: [id], map: "albumHistories_ibfk_2")
|
||||
}
|
||||
|
||||
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 @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
description String? @db.VarChar(255)
|
||||
createdBy String? @db.VarChar(255)
|
||||
status String? @db.VarChar(255)
|
||||
placeholder String? @db.Text
|
||||
headerColor String? @default("#ffffff") @db.VarChar(255)
|
||||
animList Album_Animation[]
|
||||
artistList Album_Artist[]
|
||||
categoryList Album_Category[]
|
||||
classificationList Album_Classification[]
|
||||
gameList Album_Game[]
|
||||
platformList Album_Platform[]
|
||||
Album_Type Album_Type[]
|
||||
albumHistories albumHistories[]
|
||||
availables availables[]
|
||||
comments comments[]
|
||||
discs discs[]
|
||||
downloads downloads[]
|
||||
favorites favorites[]
|
||||
linkCategories linkCategories[]
|
||||
ratings ratings[]
|
||||
relatedAlbumList related_album[] @relation("related_album_albumIdToalbums")
|
||||
relatedToAlbumList related_album[] @relation("related_album_relatedIdToalbums")
|
||||
stores stores[]
|
||||
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 @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
description String? @db.VarChar(255)
|
||||
createdBy String? @db.VarChar(255)
|
||||
status String? @db.VarChar(255)
|
||||
placeholder String? @db.Text
|
||||
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[]
|
||||
types Album_Type[]
|
||||
histories albumHistories[]
|
||||
availables availables[]
|
||||
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[]
|
||||
}
|
||||
|
||||
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)
|
||||
Album_Animation Album_Animation[]
|
||||
Studio_Animation Studio_Animation[]
|
||||
studio studio? @relation(fields: [studioSlug], references: [slug], map: "animation_ibfk_1")
|
||||
|
||||
@@index([studioSlug], map: "studioSlug")
|
||||
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)
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
Album_Artist Album_Artist[]
|
||||
slug String @id @db.VarChar(255)
|
||||
name String? @db.VarChar(255)
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albums Album_Artist[]
|
||||
}
|
||||
|
||||
model availables {
|
||||
|
|
@ -236,23 +190,21 @@ model availables {
|
|||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "availables_ibfk_1")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
album albums? @relation(fields: [albumId], references: [id], map: "availables_ibfk_1")
|
||||
}
|
||||
|
||||
model category {
|
||||
name String @id @db.VarChar(255)
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
Album_Category Album_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)
|
||||
Album_Classification Album_Classification[]
|
||||
name String @id @db.VarChar(255)
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
classifications Album_Classification[]
|
||||
}
|
||||
|
||||
model comments {
|
||||
|
|
@ -263,11 +215,8 @@ model comments {
|
|||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
username String? @db.VarChar(255)
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "comments_ibfk_1")
|
||||
users users? @relation(fields: [username], references: [id], map: "comments_ibfk_2")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
@@index([username], map: "username")
|
||||
album albums? @relation(fields: [albumId], references: [id], map: "comments_ibfk_1")
|
||||
user users? @relation(fields: [username], references: [id], map: "comments_ibfk_2")
|
||||
}
|
||||
|
||||
model config {
|
||||
|
|
@ -283,10 +232,8 @@ model discs {
|
|||
body String? @db.Text
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "discs_ibfk_1")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
albumId Int
|
||||
album albums? @relation(fields: [albumId], references: [id], map: "discs_ibfk_1")
|
||||
}
|
||||
|
||||
model downloads {
|
||||
|
|
@ -295,24 +242,19 @@ model downloads {
|
|||
small Boolean?
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
albums albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "downloads_ibfk_1")
|
||||
albumId Int
|
||||
album albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "downloads_ibfk_1")
|
||||
links links[]
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
}
|
||||
|
||||
model favorites {
|
||||
id Int @id @default(autoincrement())
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
albumId Int
|
||||
username String? @db.VarChar(255)
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "favorites_ibfk_1")
|
||||
album albums? @relation(fields: [albumId], references: [id], map: "favorites_ibfk_1")
|
||||
users users? @relation(fields: [username], references: [id], map: "favorites_ibfk_2")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
@@index([username], map: "username")
|
||||
}
|
||||
|
||||
model forgors {
|
||||
|
|
@ -322,23 +264,21 @@ model forgors {
|
|||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
username String? @db.VarChar(255)
|
||||
users users? @relation(fields: [username], references: [id], map: "forgors_ibfk_1")
|
||||
|
||||
@@index([username], map: "username")
|
||||
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)
|
||||
Album_Game Album_Game[]
|
||||
Game_Platform Game_Platform[]
|
||||
Publisher_Game Publisher_Game[]
|
||||
Series_Game Series_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 {
|
||||
|
|
@ -347,10 +287,8 @@ model linkCategories {
|
|||
small Boolean?
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "linkCategories_ibfk_1")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
albumId Int
|
||||
album albums? @relation(fields: [albumId], references: [id], map: "linkCategories_ibfk_1")
|
||||
}
|
||||
|
||||
model links {
|
||||
|
|
@ -361,11 +299,9 @@ model links {
|
|||
custom String? @db.VarChar(255)
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
downloadId Int?
|
||||
downloadId Int
|
||||
url2 String? @db.VarChar(255)
|
||||
downloads downloads? @relation(fields: [downloadId], references: [id], map: "links_ibfk_1")
|
||||
|
||||
@@index([downloadId], map: "downloadId")
|
||||
download downloads? @relation(fields: [downloadId], references: [id], map: "links_ibfk_1")
|
||||
}
|
||||
|
||||
model logs {
|
||||
|
|
@ -375,9 +311,7 @@ model logs {
|
|||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
username String? @db.VarChar(255)
|
||||
users users? @relation(fields: [username], references: [id], map: "logs_ibfk_1")
|
||||
|
||||
@@index([username], map: "username")
|
||||
user users? @relation(fields: [username], references: [id], map: "logs_ibfk_1")
|
||||
}
|
||||
|
||||
model pendings {
|
||||
|
|
@ -387,47 +321,41 @@ model pendings {
|
|||
}
|
||||
|
||||
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)
|
||||
Album_Platform Album_Platform[]
|
||||
Game_Platform Game_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)
|
||||
Publisher_Game Publisher_Game[]
|
||||
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?
|
||||
score Int
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
username String? @db.VarChar(255)
|
||||
albums albums? @relation(fields: [albumId], references: [id], map: "ratings_ibfk_1")
|
||||
users users? @relation(fields: [username], references: [id], map: "ratings_ibfk_2")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
@@index([username], map: "username")
|
||||
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 {
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
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")
|
||||
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])
|
||||
@@index([relatedId], map: "relatedId")
|
||||
}
|
||||
|
||||
model requests {
|
||||
|
|
@ -451,7 +379,7 @@ model roles {
|
|||
permissions Json?
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
User_Role User_Role[]
|
||||
users User_Role[]
|
||||
}
|
||||
|
||||
model series {
|
||||
|
|
@ -461,7 +389,7 @@ model series {
|
|||
updatedAt DateTime @db.DateTime(0)
|
||||
placeholder String? @db.Text
|
||||
headerColor String? @default("#ffffff") @db.VarChar(255)
|
||||
Series_Game Series_Game[]
|
||||
games Series_Game[]
|
||||
}
|
||||
|
||||
model stores {
|
||||
|
|
@ -471,18 +399,15 @@ model stores {
|
|||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
albumId Int?
|
||||
albums albums? @relation(fields: [albumId], references: [id], onDelete: Cascade, map: "stores_ibfk_1")
|
||||
|
||||
@@index([albumId], map: "ostId")
|
||||
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)
|
||||
Studio_Animation Studio_Animation[]
|
||||
animation animation[]
|
||||
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 {
|
||||
|
|
@ -496,19 +421,14 @@ model submissions {
|
|||
updatedAt DateTime @db.DateTime(0)
|
||||
userUsername String? @db.VarChar(255)
|
||||
requestId Int?
|
||||
users users? @relation(fields: [userUsername], references: [id], map: "submissions_ibfk_1")
|
||||
requests requests? @relation(fields: [requestId], references: [id], map: "submissions_ibfk_2")
|
||||
|
||||
@@index([requestId], map: "requestId")
|
||||
@@index([userUsername], map: "userUsername")
|
||||
user users? @relation(fields: [userUsername], references: [id], map: "submissions_ibfk_1")
|
||||
request requests? @relation(fields: [requestId], references: [id], map: "submissions_ibfk_2")
|
||||
}
|
||||
|
||||
model type {
|
||||
id Int @id @default(autoincrement())
|
||||
name String? @db.VarChar(255)
|
||||
createdAt DateTime @db.DateTime(0)
|
||||
updatedAt DateTime @db.DateTime(0)
|
||||
Album_Type Album_Type[]
|
||||
id Int @id @default(autoincrement())
|
||||
name String @db.VarChar(255)
|
||||
albums Album_Type[]
|
||||
}
|
||||
|
||||
model users {
|
||||
|
|
@ -521,16 +441,16 @@ model users {
|
|||
updatedAt DateTime @db.DateTime(0)
|
||||
image String? @db.VarChar(255)
|
||||
|
||||
roleList User_Role[]
|
||||
albumHistories albumHistories[]
|
||||
comments comments[]
|
||||
favorites favorites[]
|
||||
forgors forgors[]
|
||||
logs logs[]
|
||||
ratings ratings[]
|
||||
submissions submissions[]
|
||||
sessions session[]
|
||||
accounts account[]
|
||||
roles User_Role[]
|
||||
histories albumHistories[]
|
||||
comments comments[]
|
||||
favorites favorites[]
|
||||
forgors forgors[]
|
||||
logs logs[]
|
||||
ratings ratings[]
|
||||
submissions submissions[]
|
||||
sessions session[]
|
||||
accounts account[]
|
||||
}
|
||||
|
||||
model session {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue