-- ----------------------------
-- Table structure for blade_wf_chat_app
-- ----------------------------
DROP TABLE IF EXISTS "blade_wf_chat_app";
CREATE TABLE "blade_wf_chat_app" (
  "id" int8 NOT NULL,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "img_url" varchar(255) COLLATE "pg_catalog"."default",
  "api_url" varchar(255) COLLATE "pg_catalog"."default",
  "api_key" varchar(255) COLLATE "pg_catalog"."default",
  "api_url_prod" varchar(255) COLLATE "pg_catalog"."default",
  "api_key_prod" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "iframe_url" varchar(255) COLLATE "pg_catalog"."default",
  "iframe_url_prod" varchar(255) COLLATE "pg_catalog"."default",
  "remark" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_id" varchar(12) COLLATE "pg_catalog"."default",
  "create_user" int8,
  "create_dept" int8,
  "create_time" timestamp(6),
  "update_user" int8,
  "update_time" timestamp(6),
  "status" int4,
  "is_deleted" int4
)
;
ALTER TABLE "blade_wf_chat_app" OWNER TO "postgres";
COMMENT ON COLUMN "blade_wf_chat_app"."id" IS 'ID';
COMMENT ON COLUMN "blade_wf_chat_app"."name" IS '名称';
COMMENT ON COLUMN "blade_wf_chat_app"."img_url" IS '图片';
COMMENT ON COLUMN "blade_wf_chat_app"."api_url" IS '应用请求地址';
COMMENT ON COLUMN "blade_wf_chat_app"."api_key" IS '应用请求密钥';
COMMENT ON COLUMN "blade_wf_chat_app"."api_url_prod" IS 'prod应用请求地址';
COMMENT ON COLUMN "blade_wf_chat_app"."api_key_prod" IS 'prod应用请求密钥';
COMMENT ON COLUMN "blade_wf_chat_app"."type" IS '类型 workflow工作流 chatflow对话工作流 chat对话 agent智能体 completion文本生成应用';
COMMENT ON COLUMN "blade_wf_chat_app"."iframe_url" IS 'iframe地址';
COMMENT ON COLUMN "blade_wf_chat_app"."iframe_url_prod" IS 'prod iframe地址';
COMMENT ON COLUMN "blade_wf_chat_app"."remark" IS '备注';
COMMENT ON COLUMN "blade_wf_chat_app"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "blade_wf_chat_app"."create_user" IS '创建人';
COMMENT ON COLUMN "blade_wf_chat_app"."create_dept" IS '创建部门';
COMMENT ON COLUMN "blade_wf_chat_app"."create_time" IS '创建时间';
COMMENT ON COLUMN "blade_wf_chat_app"."update_user" IS '修改人';
COMMENT ON COLUMN "blade_wf_chat_app"."update_time" IS '修改时间';
COMMENT ON COLUMN "blade_wf_chat_app"."status" IS '状态';
COMMENT ON COLUMN "blade_wf_chat_app"."is_deleted" IS '是否已删除';
COMMENT ON TABLE "blade_wf_chat_app" IS 'dify - 应用';

-- ----------------------------
-- Table structure for blade_wf_chat_assistant
-- ----------------------------
DROP TABLE IF EXISTS "blade_wf_chat_assistant";
CREATE TABLE "blade_wf_chat_assistant" (
  "id" int8 NOT NULL,
  "app_id" int8,
  "app_type" varchar(255) COLLATE "pg_catalog"."default",
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "img_url" varchar(255) COLLATE "pg_catalog"."default",
  "description" varchar(255) COLLATE "pg_catalog"."default",
  "system_prompt" varchar(255) COLLATE "pg_catalog"."default",
  "type" varchar(255) COLLATE "pg_catalog"."default",
  "tenant_id" varchar(12) COLLATE "pg_catalog"."default",
  "create_user" int8,
  "create_dept" int8,
  "create_time" timestamp(6),
  "update_user" int8,
  "update_time" timestamp(6),
  "status" int4,
  "is_deleted" int4
)
;
ALTER TABLE "blade_wf_chat_assistant" OWNER TO "postgres";
COMMENT ON COLUMN "blade_wf_chat_assistant"."id" IS 'ID';
COMMENT ON COLUMN "blade_wf_chat_assistant"."app_id" IS '应用id';
COMMENT ON COLUMN "blade_wf_chat_assistant"."app_type" IS '应用类型';
COMMENT ON COLUMN "blade_wf_chat_assistant"."name" IS '名称';
COMMENT ON COLUMN "blade_wf_chat_assistant"."img_url" IS '图片';
COMMENT ON COLUMN "blade_wf_chat_assistant"."description" IS '描述';
COMMENT ON COLUMN "blade_wf_chat_assistant"."system_prompt" IS '系统提示词';
COMMENT ON COLUMN "blade_wf_chat_assistant"."type" IS '类型';
COMMENT ON COLUMN "blade_wf_chat_assistant"."tenant_id" IS '租户ID';
COMMENT ON COLUMN "blade_wf_chat_assistant"."create_user" IS '创建人';
COMMENT ON COLUMN "blade_wf_chat_assistant"."create_dept" IS '创建部门';
COMMENT ON COLUMN "blade_wf_chat_assistant"."create_time" IS '创建时间';
COMMENT ON COLUMN "blade_wf_chat_assistant"."update_user" IS '修改人';
COMMENT ON COLUMN "blade_wf_chat_assistant"."update_time" IS '修改时间';
COMMENT ON COLUMN "blade_wf_chat_assistant"."status" IS '状态';
COMMENT ON COLUMN "blade_wf_chat_assistant"."is_deleted" IS '是否已删除';
COMMENT ON TABLE "blade_wf_chat_assistant" IS 'dify - 应用助手';

-- ----------------------------
-- Primary Key structure for table blade_wf_chat_app
-- ----------------------------
ALTER TABLE "blade_wf_chat_app" ADD CONSTRAINT "blade_wf_chat_app_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table blade_wf_chat_assistant
-- ----------------------------
CREATE INDEX "WF_IDX_APP_ID" ON "blade_wf_chat_assistant" USING btree (
  "app_id" "pg_catalog"."int8_ops" ASC NULLS LAST
);

-- ----------------------------
-- Primary Key structure for table blade_wf_chat_assistant
-- ----------------------------
ALTER TABLE "blade_wf_chat_assistant" ADD CONSTRAINT "blade_wf_chat_assistant_pkey" PRIMARY KEY ("id");
