-- ----------------------------
-- Table structure for BLADE_WF_CHAT_APP
-- ----------------------------
DROP TABLE "BLADE_WF_CHAT_APP";
CREATE TABLE "BLADE_WF_CHAT_APP" (
  "ID" NUMBER(20,0) NOT NULL,
  "NAME" NVARCHAR2(255),
  "IMG_URL" NVARCHAR2(255),
  "API_URL" NVARCHAR2(255),
  "API_KEY" NVARCHAR2(255),
  "API_URL_PROD" NVARCHAR2(255),
  "API_KEY_PROD" NVARCHAR2(255),
  "TYPE" NVARCHAR2(255),
  "IFRAME_URL" NVARCHAR2(255),
  "IFRAME_URL_PROD" NVARCHAR2(255),
  "REMARK" NVARCHAR2(255),
  "TENANT_ID" NVARCHAR2(12),
  "CREATE_USER" NUMBER(20,0),
  "CREATE_DEPT" NUMBER(20,0),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NUMBER(20,0),
  "UPDATE_TIME" DATE,
  "STATUS" NUMBER(11,0),
  "IS_DELETED" NUMBER(11,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
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 "BLADE_WF_CHAT_ASSISTANT";
CREATE TABLE "BLADE_WF_CHAT_ASSISTANT" (
  "ID" NUMBER(20,0) NOT NULL,
  "APP_ID" NUMBER(20,0),
  "APP_TYPE" NVARCHAR2(255),
  "NAME" NVARCHAR2(255),
  "IMG_URL" NVARCHAR2(255),
  "DESCRIPTION" NVARCHAR2(255),
  "SYSTEM_PROMPT" NVARCHAR2(255),
  "TYPE" NVARCHAR2(255),
  "TENANT_ID" NVARCHAR2(12),
  "CREATE_USER" NUMBER(20,0),
  "CREATE_DEPT" NUMBER(20,0),
  "CREATE_TIME" DATE,
  "UPDATE_USER" NUMBER(20,0),
  "UPDATE_TIME" DATE,
  "STATUS" NUMBER(11,0),
  "IS_DELETED" NUMBER(11,0)
)
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
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 "SYS_C0012121" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BLADE_WF_CHAT_APP
-- ----------------------------
ALTER TABLE "BLADE_WF_CHAT_APP" ADD CONSTRAINT "SYS_C0012119" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table BLADE_WF_CHAT_ASSISTANT
-- ----------------------------
ALTER TABLE "BLADE_WF_CHAT_ASSISTANT" ADD CONSTRAINT "SYS_C0012120" PRIMARY KEY ("ID");

-- ----------------------------
-- Checks structure for table BLADE_WF_CHAT_ASSISTANT
-- ----------------------------
ALTER TABLE "BLADE_WF_CHAT_ASSISTANT" ADD CONSTRAINT "SYS_C0012118" CHECK ("ID" IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Indexes structure for table BLADE_WF_CHAT_ASSISTANT
-- ----------------------------
CREATE INDEX "WF_IDX_APP_ID"
  ON "BLADE_WF_CHAT_ASSISTANT" ("APP_ID" ASC)
  LOGGING
  VISIBLE
PCTFREE 10
INITRANS 2
STORAGE (
  BUFFER_POOL DEFAULT
);
