stayby-admin-nest/prisma/schema.prisma

82 lines
2.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

generator client {
provider = "prisma-client-js"
// previewFeatures = ["strictUndefinedChecks"]
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
// 系统人设
model SystemCharter {
id String @id @default(auto()) @map("_id") @db.ObjectId
// 角色名称
roleName String
// 角色描述
roleSetting String?
// 角色简介
prologue String
// 开场白
intro String
// 对话 json格式
roleLines String?
// 照片
photo String?
// 背景
bg String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// 音色id
voiceId String?
// 音色名称
voiceName String?
// 剩余可克隆次数
remainingCloneCount Int? @default(10)
// 原始音频
originAudioUrl String?
// 克隆音频
cloneAfterAudioUrl String?
// 是否激活
activate Boolean @default(false)
}
// 任务队列
model TaskQueue {
id String @id @default(auto()) @map("_id") @db.ObjectId
// 任务类型
type String
// 任务名称
roleName String?
// 角色id
roleId String?
// 任务数据
data String
// 任务状态: pending/processing/completed/failed
status String
// 失败原因
error String?
// 重试次数
attempts Int @default(0)
// 最大重试次数 (不需要这个逻辑了)
maxAttempts Int @default(3)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model CloneHistory {
id String @id @default(auto()) @map("_id") @db.ObjectId
roleId String // 角色ID
roleName String // 角色名称
cloneUrl String // 克隆URL
speakerId String? // 克隆后的speakerId
status String // 任务状态pending, processing, success, failed
error String? // 错误信息
taskId String? // 关联的任务ID
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}