-- ----------------------------
-- Table structure for fs_home_article
-- ----------------------------
DROP TABLE IF EXISTS `fs_home_article`;
CREATE TABLE `fs_home_article`  (
                                    `article_id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
                                    `category_id` bigint NULL DEFAULT NULL COMMENT '分类ID',
                                    `title` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '标题',
                                    `image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '封面图片',
                                    `is_tui` tinyint(1) NULL DEFAULT NULL COMMENT '是否推荐，1-是；0-否',
                                    `video_url` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '视频地址',
                                    `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '内容',
                                    `views` int NULL DEFAULT 0 COMMENT '浏览数',
                                    `sort` int NULL DEFAULT 0 COMMENT '排序',
                                    `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                    `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                    `publish_time` datetime NULL DEFAULT NULL COMMENT '发布时间',
                                    `public_status` tinyint(1) NULL DEFAULT NULL COMMENT '发布状态：1-已发布；2-草稿',
                                    `description` varchar(200) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '描述',
                                    PRIMARY KEY (`article_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '期刊表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for fs_home_article_category
-- ----------------------------
DROP TABLE IF EXISTS `fs_home_article_category`;
CREATE TABLE `fs_home_article_category`  (
                                             `category_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
                                             `category_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '分类名称',
                                             `image_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '封面图片',
                                             `status` tinyint(1) NULL DEFAULT 1 COMMENT '状态，1-正常， 0-禁用',
                                             `is_del` tinyint(1) NULL DEFAULT 0 COMMENT '是否删除，1-是，0-否',
                                             `sort` int NULL DEFAULT 1 COMMENT '排序号',
                                             `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                             `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                             PRIMARY KEY (`category_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '期刊分类表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for fs_home_article_view
-- ----------------------------
DROP TABLE IF EXISTS `fs_home_article_view`;
CREATE TABLE `fs_home_article_view`  (
                                         `view_id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
                                         `article_id` bigint NULL DEFAULT NULL COMMENT '文章ID',
                                         `user_id` bigint NULL DEFAULT NULL COMMENT '用户ID',
                                         `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                         PRIMARY KEY (`view_id`) USING BTREE,
                                         INDEX `article_id_index`(`article_id` ASC) USING BTREE,
                                         INDEX `user_id_index`(`user_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2101 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = '期刊阅读表' ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;
