Skip to content

Commit fbe4a61

Browse files
committed
fix: review comments
1 parent 2b5ecd5 commit fbe4a61

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ CREATE TABLE "aiWorkflowRunItemCommentVote" (
4141
);
4242

4343
-- CreateIndex
44-
CREATE INDEX "aiWorkflowRunItemVote_workflowRunItemId_createdBy_idx" ON "aiWorkflowRunItemVote"("workflowRunItemId", "createdBy");
44+
CREATE INDEX "aiWorkflowRunItemVote_workflowRunItemId_idx" ON "aiWorkflowRunItemVote"("workflowRunItemId");
4545

4646
-- CreateIndex
47-
CREATE INDEX "aiWorkflowRunItemCommentVote_workflowRunItemCommentId_creat_idx" ON "aiWorkflowRunItemCommentVote"("workflowRunItemCommentId", "createdBy");
47+
CREATE UNIQUE INDEX "aiWorkflowRunItemVote_workflowRunItemId_createdBy_key" ON "aiWorkflowRunItemVote"("workflowRunItemId", "createdBy");
48+
49+
-- CreateIndex
50+
CREATE INDEX "aiWorkflowRunItemCommentVote_workflowRunItemCommentId_idx" ON "aiWorkflowRunItemCommentVote"("workflowRunItemCommentId");
51+
52+
-- CreateIndex
53+
CREATE UNIQUE INDEX "aiWorkflowRunItemCommentVote_workflowRunItemCommentId_creat_key" ON "aiWorkflowRunItemCommentVote"("workflowRunItemCommentId", "createdBy");
4854

4955
-- AddForeignKey
5056
ALTER TABLE "aiWorkflowRunItemVote" ADD CONSTRAINT "aiWorkflowRunItemVote_workflowRunItemId_fkey" FOREIGN KEY ("workflowRunItemId") REFERENCES "aiWorkflowRunItem"("id") ON DELETE CASCADE ON UPDATE CASCADE;

prisma/schema.prisma

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ model aiWorkflowRunItemVote {
652652
653653
item aiWorkflowRunItem @relation(fields: [workflowRunItemId], references: [id], onDelete: Cascade)
654654
655-
@@index([workflowRunItemId, createdBy])
655+
@@index([workflowRunItemId])
656+
@@unique([workflowRunItemId, createdBy])
656657
}
657658

658659
model aiWorkflowRunItemCommentVote {
@@ -664,7 +665,8 @@ model aiWorkflowRunItemCommentVote {
664665
665666
comment aiWorkflowRunItemComment @relation(fields: [workflowRunItemCommentId], references: [id], onDelete: Cascade)
666667
667-
@@index([workflowRunItemCommentId, createdBy])
668+
@@index([workflowRunItemCommentId])
669+
@@unique([workflowRunItemCommentId, createdBy])
668670
}
669671

670672
enum VoteType {

0 commit comments

Comments
 (0)