Files
foka-ci/apps/server/prisma/schema.prisma
hurole 9897bd04c2 feat(server): 支持稀疏检出路径并完善部署执行队列
- 在部署DTO中添加sparseCheckoutPaths字段支持稀疏检出路径
- 数据模型Deployment新增稀疏检出路径字段及相关数据库映射
- 部署创建时支持设置稀疏检出路径字段
- 部署重试接口实现,支持复制原始部署记录并加入执行队列
- 新增流水线模板初始化与基于模板创建流水线接口
- 优化应用初始化流程,确保执行队列和流水线模板正确加载
- 添加启动日志,提示执行队列初始化完成
2025-12-12 23:21:26 +08:00

95 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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 = "../generated"
}
datasource db {
provider = "sqlite"
}
model Project {
id Int @id @default(autoincrement())
name String
description String?
repository String
// Relations
deployments Deployment[]
pipelines Pipeline[]
valid Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String
updatedBy String
}
model User {
id Int @id @default(autoincrement())
username String
login String
email String
avatar_url String?
active Boolean @default(true)
valid Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String @default("system")
updatedBy String @default("system")
}
model Pipeline {
id Int @id @default(autoincrement())
name String
description String?
valid Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String
updatedBy String
// Relations
projectId Int?
Project Project? @relation(fields: [projectId], references: [id])
steps Step[]
}
model Step {
id Int @id @default(autoincrement())
name String
order Int
script String // 执行的脚本命令
valid Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String
updatedBy String
pipelineId Int
pipeline Pipeline @relation(fields: [pipelineId], references: [id])
}
model Deployment {
id Int @id @default(autoincrement())
branch String
env String?
status String // pending, running, success, failed, cancelled
commitHash String?
commitMessage String?
buildLog String?
sparseCheckoutPaths String? // 稀疏检出路径用于monorepo项目
startedAt DateTime @default(now())
finishedAt DateTime?
valid Int @default(1)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy String
updatedBy String
projectId Int
Project Project? @relation(fields: [projectId], references: [id])
pipelineId Int
}