* Update Look Details Dialog with image zoom and scrollable list * add missing migration * minor change * fix test --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: yiling ji <njjyl723@gmail.com>
159 lines
4.2 KiB
Plaintext
159 lines
4.2 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
generator client {
|
|
provider = "prisma-client"
|
|
output = "../src/generated/prisma"
|
|
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
|
|
engineType = "client"
|
|
runtime = "bun"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
}
|
|
|
|
model Asset {
|
|
id String @id @default(ulid())
|
|
name String
|
|
type String
|
|
path String
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
characters Character[]
|
|
equipments Equipment[]
|
|
generations Generation[]
|
|
poses Pose[]
|
|
expressions Expression[]
|
|
|
|
@@map("assets")
|
|
}
|
|
|
|
model Character {
|
|
id String @id @default(ulid())
|
|
name String
|
|
description String?
|
|
imageId String @map("image_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
image Asset @relation(fields: [imageId], references: [id])
|
|
generations Generation[]
|
|
|
|
@@map("characters")
|
|
}
|
|
|
|
model Equipment {
|
|
id String @id @default(ulid())
|
|
name String
|
|
description String
|
|
category String
|
|
imageId String @map("image_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
image Asset @relation(fields: [imageId], references: [id])
|
|
generations GenerationEquipment[]
|
|
outfits OutfitEquipment[]
|
|
|
|
@@index([category])
|
|
@@map("equipments")
|
|
}
|
|
|
|
model Generation {
|
|
id String @id @default(ulid())
|
|
characterId String @map("character_id")
|
|
imageId String @map("image_id")
|
|
userPrompt String? @map("user_prompt")
|
|
poseId String? @map("pose")
|
|
expressionId String? @map("expression")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
character Character @relation(fields: [characterId], references: [id])
|
|
image Asset @relation(fields: [imageId], references: [id])
|
|
pose Pose? @relation(fields: [poseId], references: [id])
|
|
expression Expression? @relation(fields: [expressionId], references: [id])
|
|
equipments GenerationEquipment[]
|
|
|
|
@@map("generations")
|
|
}
|
|
|
|
model GenerationEquipment {
|
|
generationId String @map("generation_id")
|
|
equipmentId String @map("equipment_id")
|
|
|
|
generation Generation @relation(fields: [generationId], references: [id])
|
|
equipment Equipment @relation(fields: [equipmentId], references: [id])
|
|
|
|
@@id([generationId, equipmentId])
|
|
@@map("generation_equipments")
|
|
}
|
|
|
|
model Outfit {
|
|
id String @id @default(ulid())
|
|
name String
|
|
prompt String?
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
equipments OutfitEquipment[]
|
|
|
|
@@map("outfits")
|
|
}
|
|
|
|
model OutfitEquipment {
|
|
outfitId String @map("outfit_id")
|
|
equipmentId String @map("equipment_id")
|
|
|
|
outfit Outfit @relation(fields: [outfitId], references: [id], onDelete: Cascade)
|
|
equipment Equipment @relation(fields: [equipmentId], references: [id], onDelete: Cascade)
|
|
|
|
@@id([outfitId, equipmentId])
|
|
@@map("outfit_equipments")
|
|
}
|
|
|
|
model Setting {
|
|
key String @id
|
|
value String
|
|
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
@@map("settings")
|
|
}
|
|
|
|
model Pose {
|
|
id String @id @default(ulid())
|
|
name String
|
|
imageId String @map("image_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
image Asset @relation(fields: [imageId], references: [id])
|
|
generations Generation[]
|
|
|
|
@@map("poses")
|
|
}
|
|
|
|
model Expression {
|
|
id String @id @default(ulid())
|
|
name String
|
|
imageId String @map("image_id")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
|
|
// Relations
|
|
image Asset @relation(fields: [imageId], references: [id])
|
|
generations Generation[]
|
|
|
|
@@map("expressions")
|
|
}
|