/**
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(10) AUTO_INCREMENT COMMENT 'ID',
    `user_id` BIGINT(10) NOT NULL COMMENT '作者/用户ID',
    `category_id` BIGINT(10) NOT NULL COMMENT '资讯分类ID',
    `uid` VARCHAR(36) NOT NULL COMMENT 'UID',
    `is_top` TINYINT(1) DEFAULT '-1' COMMENT '是否置顶 (-1否, 1是)',
    `status` TINYINT(1) DEFAULT '1' COMMENT '资讯状态 (-1禁用, 1启用)',
    -- `audit_status` TINYINT(1) DEFAULT '1' COMMENT '审核状态 (-1审核拒绝, 1待审核, 2审核通过)',
    `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 '更新时间',
    INDEX `idx_user_id` (`user_id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='资讯表';

INSERT INTO cms_article(user_id, category_id, uid, is_top) VALUES
    (1, 3, '2a2ee08c7d', 1),
    (1, 2, 'fdd95c7c53', -1),
    (1, 2, '47add894f7', -1)
;
