From a6b502d901dee0d5f9b7e2fa8203893c2b12f8a6 Mon Sep 17 00:00:00 2001 From: fanxb Date: Thu, 23 Sep 2021 17:06:33 +0800 Subject: [PATCH] =?UTF-8?q?docs:=E6=96=B0=E5=A2=9E=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E8=A1=A8sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V19__新增公告表.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bookMarkService/web/src/main/resources/db/migration/V19__新增公告表.sql diff --git a/bookMarkService/web/src/main/resources/db/migration/V19__新增公告表.sql b/bookMarkService/web/src/main/resources/db/migration/V19__新增公告表.sql new file mode 100644 index 0000000..835f067 --- /dev/null +++ b/bookMarkService/web/src/main/resources/db/migration/V19__新增公告表.sql @@ -0,0 +1,35 @@ +-- 创建公告表 +create table notify_announce +( + notifyAnnounceId int auto_increment, + senderId int not null, + title varchar(200) not null, + content text null, + createdDate bigint(20) not null, + startDate bigint(20) not null comment '公告开始时间', + endDate bigint(20) not null comment '公告结束时间', + constraint notify_announce_pk + primary key (notifyAnnounceId) +) + comment '公告表'; + +create index notify_announce_created_date_index + on notify_announce (createdDate); + +-- 创建公告用户表 +create table user_notify_announce +( + userId int not null, + notifyAnnounceId int not null, + status tinyint default 0 null comment '0:未读,1:已读', + readDate bigint(20) null comment '阅读时间', + constraint user_announce_pk + primary key (userId, notifyAnnounceId) +) + comment '用户公告表'; +create index user_notify_announce_user_status_index + on user_notify_announce (userId, status); + +-- 用户表新增上次同步时间 +alter table user + add lastSyncAnnounceDate bigint(20) default 0 not null comment '上次同步公告时间'; \ No newline at end of file