Add tool tables

This commit is contained in:
2024-01-16 18:09:46 +08:00
parent 705449c5b1
commit e6688ccc56
27 changed files with 597 additions and 12 deletions

View File

@@ -0,0 +1,23 @@
drop table if exists t_b_tool_main;
create table if not exists t_b_tool_main
(
id bigint not null primary key,
name varchar(50) not null comment '工具名',
tool_id varchar(50) not null comment '工具 ID',
description varchar(500) null comment '简介',
base bigint not null comment '基于',
author bigint not null comment '作者',
ver varchar(20) not null comment '版本',
privately int not null default 0 comment '私有',
keyword varchar(500) not null comment '关键字',
source bigint null comment '源码',
dist bigint null comment '产物',
publish int not null default 0 comment '发布',
review varchar(10) not null default 'NONE' comment '审核',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_b_tool_main_unique_tool_id unique (tool_id, author, deleted)
) comment '工具-主表';

View File

@@ -1,12 +0,0 @@
drop table if exists t_tools;
create table if not exists t_tools (
id bigint not null primary key ,
name varchar(50) not null comment '工具名',
tool_id varchar(50) not null comment '工具 ID',
description varchar(500) null comment '简介',
version varchar(20) not null comment '版本',
private int not null default 0 comment '私有',
keyword varchar(500) not null comment '关键字',
category varchar(500) not null comment '类别'
)

View File

@@ -0,0 +1,13 @@
drop table if exists t_b_tool_category;
create table if not exists t_b_tool_category
(
id bigint not null primary key,
name varchar(50) not null comment '工具类别名',
enable int not null default 1 comment '启用',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_tool_category_name unique (name, deleted)
) comment '工具-类别表';

View File

@@ -0,0 +1,12 @@
drop table if exists t_r_tool_main_category;
create table if not exists t_r_tool_main_category
(
id bigint not null primary key,
tool_id bigint not null comment '工具',
category_id bigint not null comment '类别',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0
) comment '中间表-工具-主表-类别';

View File

@@ -0,0 +1,11 @@
drop table if exists t_b_tool_data;
create table if not exists t_b_tool_data
(
id bigint not null primary key,
data text not null comment '数据',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0
) comment '工具-数据表';

View File

@@ -0,0 +1,16 @@
drop table if exists t_b_tool_template;
create table if not exists t_b_tool_template
(
id bigint not null primary key,
name varchar(40) not null comment '模板名',
ver varchar(20) not null comment '版本',
base varchar(20) not null comment '基于',
source bigint not null comment '源码',
dist bigint not null comment '产物',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_b_tool_template_unique_name unique (name, deleted)
) comment '工具-模板表'

View File

@@ -0,0 +1,14 @@
drop table if exists t_b_tool_base;
create table if not exists t_b_tool_base
(
id bigint not null primary key,
name varchar(20) not null comment '基板名',
source bigint not null comment '源码',
dist bigint not null comment '产物',
create_time datetime not null default (utc_timestamp()) comment '创建时间',
update_time datetime not null default (utc_timestamp()) comment '修改时间',
deleted bigint not null default 0,
version int not null default 0,
constraint t_b_tool_base_unique_name unique (name, deleted)
)