protege项目数据库表

 

 

create database if not exists protege;
use protege;

create table if not exists `project_management`
(
    `id`          int unsigned                                            NOT NULL AUTO_INCREMENT COMMENT 'id',
    `name`        varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工程名',
    `description` varchar(200)                                            NOT NULL COMMENT '描述',
    `data`        text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '数据',
    `author`      varchar(50)                                             NOT NULL DEFAULT '' COMMENT '作者',
    `version`     varchar(10)                                             NOT NULL DEFAULT '' COMMENT '版本号',
    `create_time` timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`),
    UNIQUE KEY `project_management_name_uindex` (`name`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;

create table if not exists `class_management`
(
    `id`           int unsigned                                            NOT NULL AUTO_INCREMENT COMMENT 'id',
    `class_name`   varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类名',
    `project_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类关联的工程名',
    `icon_path`    varchar(100)                                            NOT NULL COMMENT '类的图标路径',
    `description`  varchar(200)                                            NOT NULL COMMENT '类的描述',
    `create_time`  timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`  timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`),
    UNIQUE KEY `project_management_name_uindex` (`class_name`, `project_name`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;


# 模板表格
create table if not exists `template_management`
(
    `id`            int unsigned                                            NOT NULL AUTO_INCREMENT COMMENT '关系id',
    `template_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '模板名字,默认为点击右键保存处的类名',
    `create_time`   timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`   timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`),
 # 唯一性的键
    UNIQUE KEY `template_management_uindex` (`template_name`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;



 # 实体表格
create table if not exists `entity_management`
(
    `id`            int unsigned                                            NOT NULL AUTO_INCREMENT COMMENT 'id',
    `entity_string` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实体字符串',
    `entity_type`   varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实体类型',
    `template_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '实体关联的模板',
    `create_time`   timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`   timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `template_name_entity` (`template_name`),
    CONSTRAINT `template_name_entity` FOREIGN KEY (`template_name`) REFERENCES `template_management` (`template_name`),
    UNIQUE KEY `entity_management_name_uindex` (`entity_string`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;



# 公理表格,公理表示实体之间的关系。
create table if not exists `axiom_management`
(
    `id`            int unsigned                                            NOT NULL AUTO_INCREMENT COMMENT 'id',
    `axiom_string`  varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公理对应字符串',
    `template_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '公理关联的模板',
    `create_time`   timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`   timestamp                                               NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `template_name_axiom` (`template_name`),
    CONSTRAINT `template_name_axiom` FOREIGN KEY (`template_name`) REFERENCES `template_management` (`template_name`),
    UNIQUE KEY `axiom_management_name_uindex` (`axiom_string`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4;

你可能感兴趣的:(java项目上手)