zhibo/follow_tables.sql
2026-01-03 15:32:31 +08:00

13 lines
613 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 用户关注表
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='用户关注表';