/**
Source Server Version: 8.0.31
Source Database: backendsys
Date: 2023/05/23 17:09:22
*/

DROP TABLE IF EXISTS `cms_article`;
CREATE TABLE `cms_article` (
    PRIMARY KEY (`id`),
    `id` BIGINT AUTO_INCREMENT COMMENT 'ID',
    `uid` VARCHAR(36) NOT NULL UNIQUE COMMENT 'UID',
    `user_id` BIGINT NOT NULL COMMENT '作者/用户ID',
    `category_id` BIGINT NOT NULL COMMENT '资讯分类ID',
    `thumb` VARCHAR(500) COMMENT '封面图',
    `is_top` TINYINT(1) DEFAULT '-1' COMMENT '是否置顶 (-1否, 1是)',
    `status` TINYINT(1) DEFAULT '1' COMMENT '资讯状态 (-1禁用, 1启用)',
    `del_flag` TINYINT(1) DEFAULT '-1' COMMENT '删除标志 (-1未删除, 1删除)',
    `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    UNIQUE KEY (`uid`),
    INDEX `idx_user_id` (`user_id`),
    INDEX `idx_category_id` (`category_id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='资讯表';

INSERT INTO cms_article(user_id, category_id, uid, is_top) VALUES
   (1, 1, 'a1b2c3d4e5', -1),
   (1, 1, 'f6g7h8i9j0', -1),
   (1, 1, 'k1l2m3n4o5', -1),
   (1, 1, 'p6q7r8s9t0', -1),
   (1, 1, 'u1v2w3x4y5', -1),
   (1, 1, 'z6a7b8c9d0', -1),
   (1, 1, 'e1f2g3h4i5', -1),
   (1, 1, 'j6k7l8m9n0', -1),
   (1, 1, 'o1p2q3r4s5', -1),
   (1, 1, 't6u7v8w9x0', -1),
   (1, 1, 'o1p2q3r4s6', -1),
   (1, 1, 't6u7v8w9x1', -1)
;
