Skip to content

Commit

Permalink
add status field on Workflow model and remove unique constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshuxkumar committed Jan 19, 2025
1 parent f6c3449 commit 5bb7ee5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
Warnings:
- Added the required column `status` to the `Workflow` table without a default value. This is not possible if the table is not empty.
*/
-- CreateEnum
CREATE TYPE "WorkflowStatus" AS ENUM ('On', 'Off');

-- DropIndex
DROP INDEX "Workflow_name_userId_key";

-- AlterTable
ALTER TABLE "Workflow" ADD COLUMN "status" "WorkflowStatus" NOT NULL;
10 changes: 7 additions & 3 deletions packages/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ model Workflow {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
triggerId String
trigger Trigger?
status WorkflowStatus
actions Action[]
workflowRuns WorkflowRun[]
@@unique([name, userId])
}

model Trigger {
Expand Down Expand Up @@ -89,4 +88,9 @@ model WorkflowRunOutbox {
workflowRunId String @unique
workflowRun WorkflowRun @relation(fields: [workflowRunId], references: [id])
}



enum WorkflowStatus {
On
Off
}

0 comments on commit 5bb7ee5

Please sign in to comment.