Refactor and add alt text generator
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[imageId,type]` on the table `ImageVariant` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ImageVariant_imageId_type_key" ON "ImageVariant"("imageId", "type");
|
@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Artist" ADD COLUMN "description" TEXT;
|
@ -0,0 +1,6 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Artist" ADD COLUMN "source" TEXT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Social" ADD COLUMN "isVisible" BOOLEAN NOT NULL DEFAULT true,
|
||||
ALTER COLUMN "isPrimary" SET DEFAULT false;
|
20
prisma/migrations/20250701210825_sortindex/migration.sql
Normal file
20
prisma/migrations/20250701210825_sortindex/migration.sql
Normal file
@ -0,0 +1,20 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Album" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Artist" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Category" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Gallery" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Image" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Social" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Tag" ADD COLUMN "sortIndex" INTEGER NOT NULL DEFAULT 0;
|
12
prisma/migrations/20250701224958_image_unique/migration.sql
Normal file
12
prisma/migrations/20250701224958_image_unique/migration.sql
Normal file
@ -0,0 +1,12 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[fileKey]` on the table `Image` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[originalFile]` on the table `Image` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Image_fileKey_key" ON "Image"("fileKey");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Image_originalFile_key" ON "Image"("originalFile");
|
@ -18,6 +18,7 @@ model Gallery {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
slug String @unique
|
||||
name String
|
||||
@ -34,6 +35,7 @@ model Album {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
slug String
|
||||
name String
|
||||
@ -54,11 +56,14 @@ model Artist {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
slug String @unique
|
||||
displayName String
|
||||
|
||||
nickname String?
|
||||
nickname String?
|
||||
description String?
|
||||
source String?
|
||||
|
||||
socials Social[]
|
||||
images Image[]
|
||||
@ -68,10 +73,12 @@ model Social {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
handle String
|
||||
platform String
|
||||
isPrimary Boolean
|
||||
isPrimary Boolean @default(false)
|
||||
isVisible Boolean @default(true)
|
||||
|
||||
link String?
|
||||
|
||||
@ -83,6 +90,7 @@ model Category {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
name String @unique
|
||||
|
||||
@ -95,6 +103,7 @@ model Tag {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
name String @unique
|
||||
|
||||
@ -107,10 +116,11 @@ model Image {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
sortIndex Int @default(0)
|
||||
|
||||
fileKey String
|
||||
fileKey String @unique
|
||||
originalFile String @unique
|
||||
imageName String
|
||||
originalFile String
|
||||
uploadDate DateTime @default(now())
|
||||
nsfw Boolean @default(false)
|
||||
|
||||
@ -204,6 +214,8 @@ model ImageVariant {
|
||||
sizeBytes Int?
|
||||
|
||||
image Image @relation(fields: [imageId], references: [id])
|
||||
|
||||
@@unique([imageId, type])
|
||||
}
|
||||
|
||||
model ColorPalette {
|
||||
|
Reference in New Issue
Block a user