zhibo/follow_tables.sql

13 lines
613 B
MySQL
Raw Normal View History

2026-01-03 15:32:31 +08:00
-- 用户关注表
CREATE TABLE IF NOT EXISTS `eb_user_follow` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`user_id` int(11) NOT NULL COMMENT '用户ID关注者',
`follow_user_id` int(11) NOT NULL COMMENT '被关注的用户ID',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '关注时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_user_follow` (`user_id`, `follow_user_id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_follow_user_id` (`follow_user_id`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户关注表';