diff --git a/db/hehui-gns-notification.sql b/db/hehui-gns-notification.sql new file mode 100644 index 0000000..4433194 --- /dev/null +++ b/db/hehui-gns-notification.sql @@ -0,0 +1,27 @@ + +USE gitlink_notification; + +-- 2021-09-10 新增测试平台 +INSERT INTO gns_platform_info(platform_code,platform_name,created_at,is_delete) VALUES('hehui','hehui平台',NOW(),-1); + +DROP TABLE IF EXISTS `hehui_sys_notification`; +CREATE TABLE `hehui_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; + +-- 2021-09-10 区分系统消息类型 +ALTER TABLE hehui_sys_notification ADD COLUMN (`type` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '消息类型: 1系统消息,2@我'); + +-- 2021-09-10 新增 source 字段区分消息来源、新增 extra 字段保存额外信息 +ALTER TABLE hehui_sys_notification ADD source varchar(250) NULL COMMENT '消息来源'; +ALTER TABLE hehui_sys_notification ADD extra TEXT NULL COMMENT '额外信息(备用字段)'; \ No newline at end of file diff --git a/model/src/main/resources/mapper/notification/SysNotificationMapper.xml b/model/src/main/resources/mapper/notification/SysNotificationMapper.xml index ec1e8fc..95df095 100644 --- a/model/src/main/resources/mapper/notification/SysNotificationMapper.xml +++ b/model/src/main/resources/mapper/notification/SysNotificationMapper.xml @@ -11,7 +11,7 @@ - +