From ab294784f23facc8ee0a3c75108f6a2bcb452479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E4=BD=B3?= Date: Thu, 16 Sep 2021 10:18:24 +0800 Subject: [PATCH] =?UTF-8?q?email=E5=BB=BA=E8=A1=A8sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/gns-notification.sql | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/db/gns-notification.sql b/db/gns-notification.sql index 1637c77..9f94f9b 100644 --- a/db/gns-notification.sql +++ b/db/gns-notification.sql @@ -35,4 +35,31 @@ ALTER TABLE gitlink_sys_notification ADD COLUMN (`type` TINYINT(4) NOT NULL DEFA -- 2021-09-09 新增 source 字段区分消息来源、新增 extra 字段保存额外信息 ALTER TABLE gitlink_sys_notification ADD source varchar(250) NULL COMMENT '消息来源'; -ALTER TABLE gitlink_sys_notification ADD extra TEXT NULL COMMENT '额外信息(备用字段)'; \ No newline at end of file +ALTER TABLE gitlink_sys_notification ADD extra TEXT NULL COMMENT '额外信息(备用字段)'; + +DROP TABLE IF EXISTS `gitlink_email_jobs`; +CREATE TABLE `gitlink_email_jobs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `sender` int(11) NOT NULL COMMENT '发送者id', + `emails` text NOT NULL COMMENT '收件人全部邮件地址', + `subject` varchar(500) DEFAULT NULL COMMENT '邮件主题', + `content` text NOT NULL COMMENT '邮件内容', + `created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `dispatched_at` datetime DEFAULT NULL COMMENT '处理时间', + `dispatched_status` int(11) DEFAULT '-1' COMMENT '发送状态:-1 未处理,1 处理成功,2 处理失败', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; + + +DROP TABLE IF EXISTS `gitlink_email_send_records`; +CREATE TABLE `gitlink_email_send_records` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `email` varchar(500) NOT NULL DEFAULT '' COMMENT '收件人邮件地址', + `job_id` int(11) NOT NULL COMMENT '邮件详情id', + `created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sent_at` datetime DEFAULT NULL COMMENT '发送时间', + `status` int(11) DEFAULT '-1' COMMENT '发送状态:-1 未发送,1 发送成功,2 发送失败', + PRIMARY KEY (`id`), + KEY `index_on_email_and_status` (`email`,`status`), + KEY `index_on_status` (`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; \ No newline at end of file