添加社会服务表

This commit is contained in:
2025-10-29 17:32:07 +08:00
parent afbf407d11
commit 139ccf2996

View File

@@ -148,7 +148,8 @@ create table meeting
start_time datetime not null comment '会议开始时间',
end_time datetime not null comment '会议结束时间',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间'
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
is_delete int default 0 not null comment '软删除'
)
comment '会议主表' charset = utf8mb4;
@@ -162,6 +163,7 @@ create table meeting_speaker
avatar varchar(512) default '' null comment '嘉宾头像URL',
intro text null comment '嘉宾简介',
sort int default 0 null comment '嘉宾排序(数字越小越靠前)',
is_delete int default 0 not null comment '软删除',
constraint fk_meeting_speaker_meeting
foreign key (meeting_id) references meeting (id)
on delete cascade
@@ -172,6 +174,44 @@ create index idx_meeting_id
on meeting_speaker (meeting_id)
comment '索引:优化按会议查询嘉宾';
create table page_image
(
id int auto_increment comment '图片ID主键'
primary key,
page varchar(50) not null comment '所属页面固定值home-首页base-基地概况research-科学研究academic-学术交流service-社会服务cases-案例资源)',
image_url varchar(512) not null comment '图片URL',
sort int not null comment '排序首页1-3对应轮播顺序其他页面固定1',
create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
constraint uk_page_sort
unique (page, sort) comment '唯一约束:同一页面+排序值只能有一条记录(控制数量)'
)
comment '页面图片表首页3张轮播其他页面1张顶部图' charset = utf8mb4;
create index idx_page
on page_image (page)
comment '按页面查询图片';
create table social_service
(
id bigint auto_increment comment '主键ID'
primary key,
title varchar(255) not null comment '标题',
subtitle varchar(255) null comment '副标题',
cover_url varchar(512) null comment '封面图片URL',
intro varchar(1000) null comment '简介(纯文字)',
content longtext null comment '内容Markdown格式',
image_editors varchar(512) null comment '图片编辑者名单(多个用逗号分隔)',
text_editors varchar(512) null comment '文字编辑者名单(多个用逗号分隔)',
chief_editor varchar(100) null comment '总编辑',
proofreaders varchar(512) null comment '校对者名单(多个用逗号分隔)',
reviewers varchar(512) null comment '审核者名单(多个用逗号分隔)',
publish_time datetime default CURRENT_TIMESTAMP null comment '发布时间(默认插入时的当前时间)',
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '最后更改时间(自动更新)',
is_delete int default 0 not null comment '软删除'
)
comment '社会服务表' charset = utf8mb4;
create table teaching_case
(
id int auto_increment comment '案例ID主键'
@@ -204,16 +244,3 @@ create table video_case
)
comment '视频案例表(独立存储,不关联其他表)' charset = utf8mb4;
CREATE TABLE page_image (
id INT NOT NULL AUTO_INCREMENT COMMENT '图片ID主键',
page VARCHAR(50) NOT NULL COMMENT '所属页面固定值home-首页base-基地概况research-科学研究academic-学术交流service-社会服务cases-案例资源)',
image_url VARCHAR(512) NOT NULL COMMENT '图片URL',
sort INT NOT NULL COMMENT '排序首页1-3对应轮播顺序其他页面固定1',
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (id),
UNIQUE KEY uk_page_sort (page, sort) COMMENT '唯一约束:同一页面+排序值只能有一条记录(控制数量)',
KEY idx_page (page) COMMENT '按页面查询图片'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '页面图片表首页3张轮播其他页面1张顶部图';