From ab9f0f5757e9fd9bb8c135d115fbc1e53f585bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8B=89=E8=BF=AA=E7=BB=B4?= Date: Mon, 6 Sep 2021 15:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4Gitlink=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=9B=B8=E5=85=B3=E7=9A=84=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、修改了 Gitlink 相关的数据库脚本 2、修改了 docker-compose 相关的脚本使之支持新的数据库脚本 --- db/gns_notification.sql | 28 ++++++++++++++++++++++++++++ db/notification.sql | 22 ---------------------- middleware/services.yml | 1 + 3 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 db/gns_notification.sql delete mode 100644 db/notification.sql diff --git a/db/gns_notification.sql b/db/gns_notification.sql new file mode 100644 index 0000000..a51d1a0 --- /dev/null +++ b/db/gns_notification.sql @@ -0,0 +1,28 @@ + +DROP TABLE IF EXISTS `gns_platform_info`; +CREATE TABLE `gns_platform_info` ( + `id` INT NOT NULL AUTO_INCREMENT, + `platform_code` VARCHAR(200) NOT NULL DEFAULT '' COMMENT '平台编码', + `platform_name` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '平台名称', + `created_at` DATETIME NOT NULL DEFAULT NOW() COMMENT '创建时间', + `updated_at` DATETIME DEFAULT NULL COMMENT '更新时间', + `is_delete` TINYINT(1) NOT NULL DEFAULT '-1' COMMENT '是否删除: -1未删除,1已删除', + PRIMARY KEY (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb3; + +INSERT INTO gns_platform_info(platform_code,platform_name,created_at,is_delete) VALUES('gitlink','Gitlink平台',NOW(),-1); + +DROP TABLE IF EXISTS `gitlink_sys_notification`; +CREATE TABLE `gitlink_sys_notification` ( + `id` INT NOT NULL AUTO_INCREMENT, + `sender` INT(11) NOT NULL COMMENT '发送者id', + `receiver` INT(11) NOT NULL COMMENT '接受者id', + `content` TEXT NOT NULL COMMENT '消息内容:富文本', + `notification_url` VARCHAR(2000) DEFAULT NULL COMMENT '消息跳转链接', + `created_at` DATETIME NOT NULL DEFAULT NOW() COMMENT '创建时间', + `status` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '已读状态: 1未读,2已读', + `is_delete` TINYINT(1) NOT NULL DEFAULT '-1' COMMENT '是否删除: -1未删除,1已删除', + PRIMARY KEY (`id`), + KEY `index_on_receiver_and_status` (`receiver`,`status`), + KEY `index_on_status` (`status`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb3; \ No newline at end of file diff --git a/db/notification.sql b/db/notification.sql deleted file mode 100644 index 4508198..0000000 --- a/db/notification.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE `platform_info` ( - `id` int NOT NULL AUTO_INCREMENT, - `platform_code` varchar(50) NOT NULL DEFAULT '' COMMENT '平台编码', - `platform_name` varchar(50) NOT NULL DEFAULT '' COMMENT '平台名称', - `created_at` datetime DEFAULT NULL COMMENT '创建时间', - `updated_at` datetime DEFAULT NULL COMMENT '更新时间', - `is_delete` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标志', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; - -CREATE TABLE `gitlink_sys_notification` ( - `id` int NOT NULL AUTO_INCREMENT, - `sender` int NOT NULL COMMENT '发送者id', - `receiver` int NOT NULL COMMENT '接受者id', - `content` text NOT NULL COMMENT '消息内容', - `notification_url` varchar(255) DEFAULT NULL COMMENT '消息跳转url', - `created_at` datetime DEFAULT NULL COMMENT '创建时间', - `status` tinyint(4) NOT NULL COMMENT '消息状态1-未读2-已读3-未删除4-已删除', - PRIMARY KEY (`id`), - KEY `index_on_receiver_and_status` (`receiver`,`status`), - KEY `index_on_status` (`status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; \ No newline at end of file diff --git a/middleware/services.yml b/middleware/services.yml index e10dedb..2e37692 100644 --- a/middleware/services.yml +++ b/middleware/services.yml @@ -12,6 +12,7 @@ services: volumes: - ${DOCKER_DATA_PATH}/mysql:/var/lib/mysql - ${SQL_SCRIPT_PATH}/xxl-job-structure.sql:/docker-entrypoint-initdb.d/0000.sql + - ${SQL_SCRIPT_PATH}/gns_notification.sql:/docker-entrypoint-initdb.d/0001.sql ports: - ${MYSQL_LOCAL_PORT}:3306 networks: -- 2.34.1