create table t_topic
(
id bigint unsigned auto_increment not null primary key comment 'id',
topic_name varchar(50) not null comment '主题名称',
create_time datetime default CURRENT_TIMESTAMP comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '创建时间'
) comment '主题表';
create table t_message
(
id bigint unsigned auto_increment not null primary key comment 'id',
topic_id bigint unsigned not null comment '主题id',
message_body text comment '消息内容',
create_time datetime default CURRENT_TIMESTAMP comment '创建时间',
update_time datetime default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP comment '创建时间',
index idx_create_time(create_time) comment '创建时间索引',
index idx_topic(topic_id) comment '主题id索引'
) comment '消息表';
评论