From 2687e5ca35db7fc394d7f74088521c8cf7084a39 Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 16 Jun 2022 16:59:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0flyway=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.6__create_dict_category.sql | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.6__create_dict_category.sql diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.6__create_dict_category.sql b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.6__create_dict_category.sql new file mode 100644 index 0000000000..b0e8a1b542 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/db/migration/V0.0.6__create_dict_category.sql @@ -0,0 +1,47 @@ +DROP TABLE IF EXISTS `ca_bm_category`; +CREATE TABLE `ca_bm_category` ( + `category_id` bigint(20) NOT NULL COMMENT '类别ID', + `category_name` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '名称', + `category_type` varchar(100) COLLATE utf8_bin DEFAULT NULL, + `category_value` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '名称值', + `parent_category_id` bigint(20) DEFAULT NULL COMMENT '父类别ID', + `category_sort` int(11) DEFAULT NULL COMMENT '展示顺序', + `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', + `create_date` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` bigint(20) DEFAULT NULL COMMENT '最后修改人', + `update_date` datetime DEFAULT NULL COMMENT '最后修改时间', + `delete_flag` varchar(10) COLLATE utf8_bin DEFAULT 'normal' COMMENT '删除状态', + `versions` int(11) DEFAULT '1' COMMENT '乐观锁', + `attribute1` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段1', + `attribute2` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段2', + `attribute3` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段3', + `attribute4` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段4', + `attribute5` varchar(240) COLLATE utf8_bin DEFAULT NULL COMMENT '扩展字段5', + `attribute6` bigint(20) DEFAULT NULL COMMENT '扩展字段6', + `attribute7` bigint(20) DEFAULT NULL COMMENT '扩展字段7', + `attribute8` bigint(20) DEFAULT NULL COMMENT '扩展字段8', + `attribute9` datetime DEFAULT NULL COMMENT '扩展字段9', + `attribute10` datetime DEFAULT NULL COMMENT '扩展字段10', + PRIMARY KEY (`category_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多级类型信息表'; + +DROP TABLE IF EXISTS `ca_sys_dict`; +CREATE TABLE `ca_sys_dict` ( + `dict_id` bigint(20) NOT NULL COMMENT '字典ID', + `dict_value` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '字典值,例如:sex/F', + `dict_label` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '1.字典组名称(性别)或者字典名称(女)', + `dict_type` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '字典值时存入字典的值,字典组时存null', + `dict_desc` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '描述', + `dict_sort` int(10) DEFAULT NULL COMMENT '排序', + `create_by` bigint(20) NOT NULL COMMENT '创建人', + `create_date` datetime NOT NULL COMMENT '创建时间', + `update_by` bigint(20) NOT NULL COMMENT '最后修改人', + `update_date` datetime NOT NULL COMMENT '最后修改时间', + `delete_flag` varchar(10) COLLATE utf8_bin NOT NULL DEFAULT 'normal' COMMENT '字典值:normal正常,deleted正常', + `versions` int(10) DEFAULT '1' COMMENT '乐观锁', + PRIMARY KEY (`dict_id`) USING BTREE, + KEY `idx_dicttype` (`dict_type`) USING BTREE, + KEY `idx_delflag` (`delete_flag`) USING BTREE, + KEY `idx_dictvalue` (`dict_value`) USING BTREE, + KEY `PK_INDEX_VLUE` (`dict_value`,`dict_type`,`delete_flag`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='字典信息表,字典值和字典组均存入此表';