create table sys_message
(
    id    bigserial not null
        primary key,
    type        integer not null,
    system      boolean not null,
    email boolean,
    sms   boolean,
    html  boolean,
    title       varchar,
    content     varchar,
    remark      varchar,
    create_time timestamp,
    create_by   varchar,
    update_time timestamp,
    update_by   varchar,
    dept_id     bigint
);

comment on table sys_message is '消息';

comment on column sys_message.type is '消息类型';

comment on column sys_message.system is '是否系统生成';

comment on column sys_message.email is '是否需要发送邮件';

comment on column sys_message.sms is '是否需要发送短信';

comment on column sys_message.html is '消息内容是否是富文本，TRUE则义富文本形式发送';

comment on column sys_message.title is '标题';

comment on column sys_message.content is '消息内容';

comment on column sys_message.remark is '说明';

comment on column sys_message.create_time is '创建时间';

comment on column sys_message.create_by is '创建人';

comment on column sys_message.update_time is '更新时间';

comment on column sys_message.update_by is '更新人';

comment on column sys_message.dept_id is '部门权限id';

alter table sys_message
    owner to gitea;
