Rename pipeline schema (#184)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
-- CreateEnum
|
||||
CREATE TYPE "PipelineAssociableType" AS ENUM ('Person', 'Company');
|
||||
CREATE TYPE "PipelineProgressableType" AS ENUM ('Person', 'Company');
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "pipelines" (
|
||||
@ -30,17 +30,17 @@ CREATE TABLE "pipeline_stages" (
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "pipeline_associations" (
|
||||
CREATE TABLE "pipeline_progresses" (
|
||||
"id" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
"deletedAt" TIMESTAMP(3),
|
||||
"pipelineId" TEXT NOT NULL,
|
||||
"pipelineStageId" TEXT NOT NULL,
|
||||
"associableType" "PipelineAssociableType" NOT NULL,
|
||||
"associableType" "PipelineProgressableType" NOT NULL,
|
||||
"associableId" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "pipeline_associations_pkey" PRIMARY KEY ("id")
|
||||
CONSTRAINT "pipeline_progresses_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
@ -53,7 +53,7 @@ ALTER TABLE "pipeline_stages" ADD CONSTRAINT "pipeline_stages_pipelineId_fkey" F
|
||||
ALTER TABLE "pipeline_stages" ADD CONSTRAINT "pipeline_stages_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "workspaces"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "pipeline_associations" ADD CONSTRAINT "pipeline_associations_pipelineId_fkey" FOREIGN KEY ("pipelineId") REFERENCES "pipelines"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE "pipeline_progresses" ADD CONSTRAINT "pipeline_progresses_pipelineId_fkey" FOREIGN KEY ("pipelineId") REFERENCES "pipelines"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "pipeline_associations" ADD CONSTRAINT "pipeline_associations_pipelineStageId_fkey" FOREIGN KEY ("pipelineStageId") REFERENCES "pipeline_stages"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE "pipeline_progresses" ADD CONSTRAINT "pipeline_progresses_pipelineStageId_fkey" FOREIGN KEY ("pipelineStageId") REFERENCES "pipeline_stages"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user