feat(ST-350): add Story.assignee_id schema migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
30126ff8ff
commit
fa34f680b3
3 changed files with 28 additions and 14 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
ALTER TYPE "TaskStatus" ADD VALUE 'REVIEW';
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "stories" ADD COLUMN "assignee_id" TEXT;
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "stories_sprint_id_assignee_id_idx" ON "stories"("sprint_id", "assignee_id");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "stories" ADD CONSTRAINT "stories_assignee_id_fkey" FOREIGN KEY ("assignee_id") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
@ -26,6 +26,7 @@ enum StoryStatus {
|
||||||
enum TaskStatus {
|
enum TaskStatus {
|
||||||
TO_DO
|
TO_DO
|
||||||
IN_PROGRESS
|
IN_PROGRESS
|
||||||
|
REVIEW
|
||||||
DONE
|
DONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,20 +47,21 @@ enum SprintStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
model User {
|
model User {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
username String @unique
|
username String @unique
|
||||||
password_hash String
|
password_hash String
|
||||||
is_demo Boolean @default(false)
|
is_demo Boolean @default(false)
|
||||||
bio String? @db.VarChar(160)
|
bio String? @db.VarChar(160)
|
||||||
bio_detail String? @db.VarChar(2000)
|
bio_detail String? @db.VarChar(2000)
|
||||||
avatar_data Bytes?
|
avatar_data Bytes?
|
||||||
created_at DateTime @default(now())
|
created_at DateTime @default(now())
|
||||||
updated_at DateTime @updatedAt
|
updated_at DateTime @updatedAt
|
||||||
roles UserRole[]
|
roles UserRole[]
|
||||||
api_tokens ApiToken[]
|
api_tokens ApiToken[]
|
||||||
products Product[]
|
products Product[]
|
||||||
todos Todo[]
|
todos Todo[]
|
||||||
product_members ProductMember[]
|
product_members ProductMember[]
|
||||||
|
assigned_stories Story[] @relation("StoryAssignee")
|
||||||
|
|
||||||
@@map("users")
|
@@map("users")
|
||||||
}
|
}
|
||||||
|
|
@ -133,6 +135,8 @@ model Story {
|
||||||
product_id String
|
product_id String
|
||||||
sprint Sprint? @relation(fields: [sprint_id], references: [id])
|
sprint Sprint? @relation(fields: [sprint_id], references: [id])
|
||||||
sprint_id String?
|
sprint_id String?
|
||||||
|
assignee User? @relation("StoryAssignee", fields: [assignee_id], references: [id], onDelete: SetNull)
|
||||||
|
assignee_id String?
|
||||||
title String
|
title String
|
||||||
description String?
|
description String?
|
||||||
acceptance_criteria String?
|
acceptance_criteria String?
|
||||||
|
|
@ -147,6 +151,7 @@ model Story {
|
||||||
@@index([pbi_id, priority, sort_order])
|
@@index([pbi_id, priority, sort_order])
|
||||||
@@index([sprint_id, sort_order])
|
@@index([sprint_id, sort_order])
|
||||||
@@index([product_id, status])
|
@@index([product_id, status])
|
||||||
|
@@index([sprint_id, assignee_id])
|
||||||
@@map("stories")
|
@@map("stories")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue