first init
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
// Prisma schema for Login-Less Real-Time Agile Kanban Board (PostgreSQL)
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
enum Priority {
|
||||
LOW
|
||||
MEDIUM
|
||||
HIGH
|
||||
URGENT
|
||||
}
|
||||
|
||||
model Board {
|
||||
id String @id @default(uuid())
|
||||
title String @default("Agile Kanban Board")
|
||||
adminKeyHash String
|
||||
memberKeyHash String
|
||||
autoMoveStale Boolean @default(false) // Auto move stale cards to Backlog
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
columns Column[]
|
||||
activityLogs ActivityLog[]
|
||||
|
||||
@@index([updatedAt])
|
||||
}
|
||||
|
||||
model Column {
|
||||
id String @id @default(uuid())
|
||||
boardId String
|
||||
board Board @relation(fields: [boardId], references: [id], onDelete: Cascade)
|
||||
title String
|
||||
order Int @default(0)
|
||||
maxWipLimit Int @default(0) // 0 = unlimited, >0 = max cards limit
|
||||
autoStaleHours Int @default(0) // 0 = disabled, >0 = hours before marking stale
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
tickets Ticket[]
|
||||
|
||||
@@index([boardId, order])
|
||||
}
|
||||
|
||||
model Ticket {
|
||||
id String @id @default(uuid())
|
||||
columnId String
|
||||
column Column @relation(fields: [columnId], references: [id], onDelete: Cascade)
|
||||
title String
|
||||
description String @default("")
|
||||
order Int @default(0)
|
||||
priority Priority @default(MEDIUM)
|
||||
tags String @default("[]") // JSON serialized array of tag strings
|
||||
subtasks String @default("[]") // JSON serialized array of { id, title, completed }
|
||||
dueDate String? @default("")
|
||||
isBlocked Boolean @default(false)
|
||||
blockedReason String? @default("")
|
||||
assignee String? @default("")
|
||||
movedAt DateTime @default(now()) // Timestamp when card entered column
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
activityLogs ActivityLog[]
|
||||
|
||||
@@index([columnId, order])
|
||||
}
|
||||
|
||||
model ActivityLog {
|
||||
id String @id @default(uuid())
|
||||
boardId String
|
||||
board Board @relation(fields: [boardId], references: [id], onDelete: Cascade)
|
||||
ticketId String?
|
||||
ticket Ticket? @relation(fields: [ticketId], references: [id], onDelete: Cascade)
|
||||
ticketTitle String @default("")
|
||||
action String @default("MOVED") // MOVED, CREATED, BLOCKED, UNBLOCKED, DELETED
|
||||
fromColumnTitle String? @default("")
|
||||
toColumnTitle String? @default("")
|
||||
userName String @default("User")
|
||||
details String? @default("")
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([boardId, createdAt])
|
||||
@@index([ticketId, createdAt])
|
||||
}
|
||||
Reference in New Issue
Block a user