Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Warnings:
- - Changed the type of `node_id` on the `flow_filters` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- - Changed the type of `node_id` on the `flow_messages` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- */
- -- CreateEnum
- CREATE TYPE "t_flow_nodes_type" AS ENUM ('trigger', 'action');
- -- AlterTable
- ALTER TABLE "flow_filters" DROP COLUMN "node_id",
- ADD COLUMN "node_id" UUID NOT NULL;
- -- AlterTable
- ALTER TABLE "flow_messages" DROP COLUMN "node_id",
- ADD COLUMN "node_id" UUID NOT NULL;
- -- CreateTable
- CREATE TABLE "flow_nodes" (
- "id" UUID NOT NULL DEFAULT gen_random_uuid(),
- "name" TEXT NOT NULL,
- "flow_id" UUID NOT NULL,
- "external_id" TEXT,
- "type" "t_flow_nodes_type" NOT NULL,
- "created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
- "updated_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
- CONSTRAINT "flow_nodes_pkey" PRIMARY KEY ("id")
- );
- -- AddForeignKey
- ALTER TABLE "flow_filters" ADD CONSTRAINT "flow_filters_node_id_fkey" FOREIGN KEY ("node_id") REFERENCES "flow_nodes"("id") ON DELETE CASCADE ON UPDATE NO ACTION;
- -- AddForeignKey
- ALTER TABLE "flow_nodes" ADD CONSTRAINT "flow_nodes_flow_id_fkey" FOREIGN KEY ("flow_id") REFERENCES "workflows"("id") ON DELETE CASCADE ON UPDATE NO ACTION;
- -- AddForeignKey
- ALTER TABLE "flow_messages" ADD CONSTRAINT "flow_messages_node_id_fkey" FOREIGN KEY ("node_id") REFERENCES "flow_nodes"("id") ON DELETE CASCADE ON UPDATE NO ACTION;
Advertisement
Add Comment
Please, Sign In to add comment