-- 创建轮播图表
CREATE TABLE IF NOT EXISTS t_carousel (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(100) NOT NULL COMMENT '新闻标题',
    content TEXT COMMENT '新闻内容',
    sort_order INT DEFAULT 99999 COMMENT '播放顺序',
    state TINYINT DEFAULT 1 COMMENT '状态：1-正常，0-删除',
    create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    create_by BIGINT COMMENT '创建人ID',
    update_by BIGINT COMMENT '更新人ID'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='轮播图（新闻与推广）表';

-- 创建索引
CREATE INDEX idx_carousel_sort_order ON t_carousel(sort_order);
CREATE INDEX idx_carousel_state ON t_carousel(state);
CREATE INDEX idx_carousel_create_time ON t_carousel(create_time);