zhibo/room_category_table.sql
2026-01-03 12:24:05 +08:00

23 lines
1.1 KiB
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_live_room_category` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分类ID',
`name` varchar(50) NOT NULL COMMENT '分类名称',
`icon` varchar(255) DEFAULT NULL COMMENT '图标类名或URL',
`sort` int(11) DEFAULT 0 COMMENT '排序',
`status` tinyint(1) DEFAULT 1 COMMENT '状态0-禁用1-启用',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='直播间分类表';
-- 初始化一些默认分类
INSERT INTO `eb_live_room_category` (`name`, `icon`, `sort`, `status`) VALUES
('娱乐', 'el-icon-video-camera', 1, 1),
('游戏', 'el-icon-coordinate', 2, 1),
('音乐', 'el-icon-headset', 3, 1),
('户外', 'el-icon-location', 4, 1),
('聊天', 'el-icon-chat-dot-round', 5, 1);
-- 给 eb_live_room 表添加 category_id 字段(如果不存在)
-- ALTER TABLE `eb_live_room` ADD COLUMN `category_id` int(11) DEFAULT NULL COMMENT '分类ID' AFTER `streamer_name`;