Add tags and categories CRUD
This commit is contained in:
@ -103,19 +103,19 @@ model Image {
|
||||
// sourceId String?
|
||||
// source Source? @relation(fields: [sourceId], references: [id])
|
||||
|
||||
colors ImageColor[]
|
||||
extractColors ExtractColor[]
|
||||
metadata ImageMetadata[]
|
||||
pixels PixelSummary[]
|
||||
stats ImageStats[]
|
||||
theme ThemeSeed[]
|
||||
variants ImageVariant[]
|
||||
//
|
||||
metadata ImageMetadata[]
|
||||
pixels PixelSummary[]
|
||||
stats ImageStats[]
|
||||
theme ThemeSeed[]
|
||||
variants ImageVariant[]
|
||||
|
||||
// albumCover Album[] @relation("AlbumCoverImage")
|
||||
// categories Category[] @relation("ImageCategories")
|
||||
// galleryCover Gallery[] @relation("GalleryCoverImage")
|
||||
palettes ColorPalette[] @relation("ImagePalettes")
|
||||
// tags Tag[] @relation("ImageTags")
|
||||
categories Category[] @relation("ImageCategories")
|
||||
colors ImageColor[] @relation("ImageToImageColor")
|
||||
extractColors ExtractColor[] @relation("ImageToExtractColor")
|
||||
palettes ColorPalette[] @relation("ImagePalettes")
|
||||
tags Tag[] @relation("ImageTags")
|
||||
}
|
||||
|
||||
model ImageMetadata {
|
||||
@ -183,8 +183,8 @@ model ColorPalette {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
name String?
|
||||
type String?
|
||||
name String
|
||||
type String
|
||||
|
||||
items ColorPaletteItem[]
|
||||
images Image[] @relation("ImagePalettes")
|
||||
@ -207,17 +207,17 @@ model ExtractColor {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
hex String
|
||||
imageId String
|
||||
blue Int
|
||||
green Int
|
||||
red Int
|
||||
name String @unique
|
||||
hex String
|
||||
blue Int
|
||||
green Int
|
||||
red Int
|
||||
|
||||
area Float?
|
||||
hue Float?
|
||||
saturation Float?
|
||||
|
||||
image Image @relation(fields: [imageId], references: [id])
|
||||
images Image[] @relation("ImageToExtractColor")
|
||||
}
|
||||
|
||||
model ImageColor {
|
||||
@ -225,15 +225,15 @@ model ImageColor {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
imageId String
|
||||
type String
|
||||
name String @unique
|
||||
type String
|
||||
|
||||
hex String?
|
||||
blue Int?
|
||||
green Int?
|
||||
red Int?
|
||||
|
||||
image Image @relation(fields: [imageId], references: [id])
|
||||
images Image[] @relation("ImageToImageColor")
|
||||
}
|
||||
|
||||
model ThemeSeed {
|
||||
@ -259,3 +259,27 @@ model PixelSummary {
|
||||
|
||||
image Image @relation(fields: [imageId], references: [id])
|
||||
}
|
||||
|
||||
model Category {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
name String @unique
|
||||
|
||||
description String?
|
||||
|
||||
images Image[] @relation("ImageCategories")
|
||||
}
|
||||
|
||||
model Tag {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
name String @unique
|
||||
|
||||
description String?
|
||||
|
||||
images Image[] @relation("ImageTags")
|
||||
}
|
||||
|
Reference in New Issue
Block a user