feat: Todo altijd gekoppeld aan product backlog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-25 12:35:40 +02:00
parent b541379964
commit cb7eb36fbb
9 changed files with 128 additions and 46 deletions

View file

@ -0,0 +1,8 @@
-- AlterTable
ALTER TABLE "todos" ADD COLUMN "product_id" TEXT;
-- CreateIndex
CREATE INDEX "todos_user_id_product_id_idx" ON "todos"("user_id", "product_id");
-- AddForeignKey
ALTER TABLE "todos" ADD CONSTRAINT "todos_product_id_fkey" FOREIGN KEY ("product_id") REFERENCES "products"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View file

@ -92,6 +92,7 @@ model Product {
pbis Pbi[]
sprints Sprint[]
stories Story[]
todos Todo[]
@@unique([user_id, name])
@@index([user_id, archived])
@ -170,18 +171,19 @@ model Sprint {
}
model Task {
id String @id @default(cuid())
story Story @relation(fields: [story_id], references: [id], onDelete: Cascade)
story_id String
sprint Sprint? @relation(fields: [sprint_id], references: [id])
sprint_id String?
title String
description String?
priority Int
sort_order Float
status TaskStatus @default(TO_DO)
created_at DateTime @default(now())
updated_at DateTime @updatedAt
id String @id @default(cuid())
story Story @relation(fields: [story_id], references: [id], onDelete: Cascade)
story_id String
sprint Sprint? @relation(fields: [sprint_id], references: [id])
sprint_id String?
title String
description String?
implementation_plan String?
priority Int
sort_order Float
status TaskStatus @default(TO_DO)
created_at DateTime @default(now())
updated_at DateTime @updatedAt
@@index([story_id, priority, sort_order])
@@index([sprint_id, status])
@ -192,6 +194,8 @@ model Todo {
id String @id @default(cuid())
user User @relation(fields: [user_id], references: [id], onDelete: Cascade)
user_id String
product Product? @relation(fields: [product_id], references: [id], onDelete: SetNull)
product_id String?
title String
done Boolean @default(false)
archived Boolean @default(false)
@ -199,5 +203,6 @@ model Todo {
updated_at DateTime @updatedAt
@@index([user_id, done, archived])
@@index([user_id, product_id])
@@map("todos")
}