Browse Source

1、修改抽象关系表
2、新增实例实体关系对照表

alibct 2 years ago
parent
commit
0e9a28099e
1 changed files with 26 additions and 4 deletions
  1. 26 4
      sql/init.sql

+ 26 - 4
sql/init.sql

@@ -244,12 +244,11 @@ create table sys_entity_instance
     remark      varchar(512) default '' comment '备注',
     remark      varchar(512) default '' comment '备注',
     primary key (entity_id)
     primary key (entity_id)
 ) engine = innodb comment = '图谱实体实例表';
 ) engine = innodb comment = '图谱实体实例表';
-
 -- ----------------------------
 -- ----------------------------
--- 10、图谱关系表
+-- 10、图谱关系表-抽象表
 -- ----------------------------
 -- ----------------------------
-drop table if exists sys_entity_relation;
-create table sys_entity_relation
+drop table if exists sys_relation;
+create table sys_relation
 (
 (
     relation_id   varchar(32) not null comment '关系ID',
     relation_id   varchar(32) not null comment '关系ID',
     kg_id         varchar(32) not null comment '图谱ID',
     kg_id         varchar(32) not null comment '图谱ID',
@@ -270,3 +269,26 @@ create table sys_entity_relation
     primary key (relation_id)
     primary key (relation_id)
 ) engine = innodb comment = '图谱关系表';
 ) engine = innodb comment = '图谱关系表';
 
 
+-- ----------------------------
+-- 11、图谱实体-关系对照表
+-- ----------------------------
+drop table if exists sys_entity_relation;
+create table sys_entity_relation
+(
+    id          varchar(32) not null comment '关系ID',
+    kg_id       varchar(32) not null comment '图谱ID',
+    user_id     bigint(20)  not null comment '用户ID',
+    start       varchar(64) not null comment '类目/起始点实例名称',
+    start_id    varchar(32) not null comment '类目/起始点实例id',
+    relation    varchar(64) not null comment '属性/关系名称',
+    relation_id varchar(32) not null comment '属性/关系id',
+    end         varchar(64) not null comment '值类型/终止点类型实例名称',
+    end_id      varchar(32) not null comment '终止点实例id',
+    create_by   varchar(64)  default '' comment '创建者',
+    create_time datetime comment '创建时间',
+    update_by   varchar(64)  default '' comment '更新者',
+    update_time datetime comment '更新时间',
+    remark      varchar(512) default '' comment '备注',
+    primary key (id)
+) engine = innodb comment = '图谱实体-关系对照表';
+