-- ----------------------------
|
-- 17、通知公告表
|
-- ----------------------------
|
|
drop table if exists sys_notice;
|
create table sys_notice
|
(
|
notice_id serial primary key, -- 使用 serial 实现自增
|
notice_title varchar(50) not null, -- 公告标题
|
notice_type char(1) not null, -- 公告类型(1通知 2公告)
|
notice_content bytea default null, -- 公告内容,使用 bytea 存储二进制数据
|
status char(1) default '0', -- 公告状态(0正常 1关闭)
|
create_by varchar(64) default '', -- 创建者
|
create_time timestamp default current_timestamp, -- 创建时间,使用 PostgreSQL 的 current_timestamp
|
update_by varchar(64) default '', -- 更新者
|
update_time timestamp, -- 更新时间
|
remark varchar(255) default null -- 备注
|
);
|
|
-- 表注释
|
comment on table sys_notice is '通知公告表';
|
|
-- 字段注释
|
comment on column sys_notice.notice_id is '公告ID';
|
comment on column sys_notice.notice_title is '公告标题';
|
comment on column sys_notice.notice_type is '公告类型(1通知 2公告)';
|
comment on column sys_notice.notice_content is '公告内容';
|
comment on column sys_notice.status is '公告状态(0正常 1关闭)';
|
comment on column sys_notice.create_by is '创建者';
|
comment on column sys_notice.create_time is '创建时间';
|
comment on column sys_notice.update_by is '更新者';
|
comment on column sys_notice.update_time is '更新时间';
|
comment on column sys_notice.remark is '备注';
|
|
-- ----------------------------
|
-- 初始化-公告信息表数据
|
-- ----------------------------
|
|
insert into sys_notice (notice_title, notice_type, notice_content, status, create_by, create_time, update_by,
|
update_time, remark)
|
values ('温馨提醒:2018-07-01 若依新版本发布啦', '2', '新版本内容'::bytea, '0', 'admin', current_timestamp, '', null,
|
'管理员');
|
|
insert into sys_notice (notice_title, notice_type, notice_content, status, create_by, create_time, update_by,
|
update_time, remark)
|
values ('维护通知:2018-07-01 若依系统凌晨维护', '1', '维护内容'::bytea, '0', 'admin', current_timestamp, '', null,
|
'管理员');
|