-- DropForeignKey
ALTER TABLE "WorkflowTemplateStep" DROP CONSTRAINT "WorkflowTemplateStep_workflowTemplateId_fkey";

-- CreateTable
CREATE TABLE "WorkflowTemplateStepInstitution" (
    "id" TEXT NOT NULL,
    "group" TEXT NOT NULL,
    "workflowTemplateStepId" TEXT NOT NULL,

    CONSTRAINT "WorkflowTemplateStepInstitution_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "WorkflowTemplateStepInstitution" ADD CONSTRAINT "WorkflowTemplateStepInstitution_workflowTemplateStepId_fkey" FOREIGN KEY ("workflowTemplateStepId") REFERENCES "WorkflowTemplateStep"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "WorkflowTemplateStep" ADD CONSTRAINT "WorkflowTemplateStep_workflowTemplateId_fkey" FOREIGN KEY ("workflowTemplateId") REFERENCES "WorkflowTemplate"("id") ON DELETE CASCADE ON UPDATE CASCADE;
