添加公告表及相关处理逻辑,支持公告列表查询

This commit is contained in:
2025-05-07 16:48:02 +08:00
parent 1738570c2b
commit 60bbe47368
7 changed files with 494 additions and 1 deletions

View File

@@ -84,6 +84,36 @@ comment on column admin_role.created_at is '创建时间';
comment on column admin_role.updated_at is '更新时间';
comment on column admin_role.deleted_at is '删除时间';
-- announcement
drop table if exists announcement cascade;
create table announcement (
id serial primary key,
title varchar(255) not null,
content text,
type int not null default 1,
pin bool not null default false,
status int not null default 1,
sort int not null default 0,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp,
deleted_at timestamp
);
create index announcement_status_index on announcement (status);
create index announcement_deleted_at_index on announcement (deleted_at);
-- announcement表字段注释
comment on table announcement is '公告表';
comment on column announcement.id is '公告ID';
comment on column announcement.title is '公告标题';
comment on column announcement.content is '公告内容';
comment on column announcement.type is '公告类型1-普通公告';
comment on column announcement.status is '公告状态0-禁用1-正常';
comment on column announcement.pin is '是否置顶';
comment on column announcement.sort is '公告排序';
comment on column announcement.created_at is '创建时间';
comment on column announcement.updated_at is '更新时间';
comment on column announcement.deleted_at is '删除时间';
-- endregion
-- ====================