DROP TABLE IF EXISTS "lqbz"."als_k_graph_task_t";
CREATE TABLE "lqbz"."als_k_graph_task_t"(
                                           id bigint NOT NULL,
                                           task_name VARCHAR2(255),
                                           task_type VARCHAR2(255),
                                           oss_id bigint,
                                           status char(1) DEFAULT (0),
                                           remarks VARCHAR2(900),
                                           tenant_id bigint,
                                           del_flag bit DEFAULT  0,
                                           version INTEGER,
                                           create_by bigint,
                                           create_time TIMESTAMP,
                                           update_by bigint,
                                           update_time TIMESTAMP
);

ALTER TABLE "lqbz"."als_k_graph_task_t" ADD CONSTRAINT PRIMARY KEY (id);

COMMENT ON TABLE "lqbz"."als_k_graph_task_t" IS '知识图谱任务';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."id" IS '唯一ID';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."task_name" IS '任务名称';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."task_type" IS '任务类型';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."oss_id" IS '原始文件';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."status" IS '状态';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."remarks" IS '备注';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."tenant_id" IS '租户号';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."del_flag" IS '删除标识（1删除 0未删除）';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."version" IS '乐观锁';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."create_by" IS '创建人';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."create_time" IS '创建时间';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."update_by" IS '更新人';
COMMENT ON COLUMN "lqbz"."als_k_graph_task_t"."update_time" IS '更新时间';
DROP TABLE IF EXISTS "lqbz"."als_k_graph_clause_t";
CREATE TABLE "lqbz"."als_k_graph_clause_t"(
                                             id bigint NOT NULL,
                                             task_id bigint,
                                             clause VARCHAR2(1500),
                                             status char(1) DEFAULT (0),
                                             remarks VARCHAR2(900),
                                             tenant_id bigint,
                                             del_flag bit DEFAULT  0,
                                             version INTEGER,
                                             create_by bigint,
                                             create_time TIMESTAMP,
                                             update_by bigint,
                                             update_time TIMESTAMP
);

ALTER TABLE "lqbz"."als_k_graph_clause_t" ADD CONSTRAINT PRIMARY KEY (id);

COMMENT ON TABLE "lqbz"."als_k_graph_clause_t" IS '知识图谱分句结果';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."id" IS '唯一ID';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."task_id" IS '任务ID';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."clause" IS '分句结果文件';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."status" IS '状态';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."remarks" IS '备注';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."tenant_id" IS '租户号';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."del_flag" IS '删除标识（1删除 0未删除）';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."version" IS '乐观锁';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."create_by" IS '创建人';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."create_time" IS '创建时间';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."update_by" IS '更新人';
COMMENT ON COLUMN "lqbz"."als_k_graph_clause_t"."update_time" IS '更新时间';
DROP TABLE IF EXISTS "lqbz"."als_k_graph_entity_t";
CREATE TABLE "lqbz"."als_k_graph_entity_t"(
                                             id bigint NOT NULL,
                                             clause_id bigint,
                                             head_entity VARCHAR2(900),
                                             head_entity_class VARCHAR2(900),
                                             relation VARCHAR2(900),
                                             tail_entity VARCHAR2(900),
                                             tail_entity_class VARCHAR2(900),
                                             status char(1),
                                             remarks VARCHAR2(900),
                                             tenant_id bigint,
                                             del_flag bit DEFAULT  0,
                                             version INTEGER,
                                             create_by bigint,
                                             create_time TIMESTAMP,
                                             update_by bigint,
                                             update_time TIMESTAMP
);

ALTER TABLE "lqbz"."als_k_graph_entity_t" ADD CONSTRAINT PRIMARY KEY (id);

COMMENT ON TABLE "lqbz"."als_k_graph_entity_t" IS '知识图谱实体关系';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."id" IS '唯一ID';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."clause_id" IS '分句ID';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."head_entity" IS '头实体';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."head_entity_class" IS '头实体类';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."relation" IS '关系';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."tail_entity" IS '尾实体';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."tail_entity_class" IS '尾实体类';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."status" IS '状态';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."remarks" IS '备注';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."tenant_id" IS '租户号';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."del_flag" IS '删除标识（1删除 0未删除）';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."version" IS '乐观锁';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."create_by" IS '创建人';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."create_time" IS '创建时间';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."update_by" IS '更新人';
COMMENT ON COLUMN "lqbz"."als_k_graph_entity_t"."update_time" IS '更新时间';

