text: -- DropForeignKey
  ALTER TABLE "Comment" DROP CONSTRAINT "Comment_createdBy_fkey";
  
  -- DropForeignKey
  ALTER TABLE "NextStep" DROP CONSTRAINT "NextStep_workflowId_fkey";
  
  -- DropForeignKey
  ALTER TABLE "Revision" DROP CONSTRAINT "Revision_createdBy_fkey";
  
  -- DropForeignKey
  ALTER TABLE "Workflow" DROP CONSTRAINT "Workflow_createdBy_fkey";
  
  -- AlterTable
  ALTER TABLE "Workflow" ADD COLUMN     "episodeId" TEXT;
  
  -- CreateTable
  CREATE TABLE "Episode" (
      "id" TEXT NOT NULL,
  
      CONSTRAINT "Episode_pkey" PRIMARY KEY ("id")
  );
  
  -- AddForeignKey
  ALTER TABLE "Workflow" ADD CONSTRAINT "Workflow_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "User"("email") ON DELETE RESTRICT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Workflow" ADD CONSTRAINT "Workflow_episodeId_fkey" FOREIGN KEY ("episodeId") REFERENCES "Episode"("id") ON DELETE SET NULL ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "NextStep" ADD CONSTRAINT "NextStep_workflowId_fkey" FOREIGN KEY ("workflowId") REFERENCES "Workflow"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Comment" ADD CONSTRAINT "Comment_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "User"("email") ON DELETE RESTRICT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Revision" ADD CONSTRAINT "Revision_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "User"("email") ON DELETE RESTRICT ON UPDATE CASCADE;
  
  -- RenameIndex
  ALTER INDEX "User.email_unique" RENAME TO "User_email_key";
  
  -- RenameIndex
  ALTER INDEX "VerificationRequest.identifier_token_unique" RENAME TO "VerificationRequest_identifier_token_key";
  
  -- RenameIndex
  ALTER INDEX "VerificationRequest.token_unique" RENAME TO "VerificationRequest_token_key";
  
  -- RenameIndex
  ALTER INDEX "Workflow.workflowId_unique" RENAME TO "Workflow_workflowId_key";
  