CREATE TABLE "pi_history" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY  NOT NULL, "user_id" bigint NOT NULL, "pipeline_id" bigint NOT NULL, "pipeline" varchar(40960), "status" varchar(20), "end_time" timestamp, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));

CREATE TABLE "pi_history_log" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY  NOT NULL, "user_id" bigint NOT NULL, "pipeline_id" bigint NOT NULL, "history_id" bigint NOT NULL, "node_id" varchar(100), "logs" varchar(40960), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));

CREATE TABLE "pi_pipeline" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY  NOT NULL, "user_id" bigint NOT NULL, "title" bigint NOT NULL, "content" varchar(40960) NOT NULL, "keep_history_count" bigint, "remark" varchar(100), "status" varchar(100), "disabled" boolean DEFAULT (false), "last_history_time" bigint, "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));

CREATE TABLE "pi_storage" ("id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY  NOT NULL, "user_id" bigint NOT NULL, "scope" varchar NOT NULL, "namespace" varchar NOT NULL, "version" varchar(100),"key" varchar(100), "value" varchar(40960), "create_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP), "update_time" timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP));
