/*
 Navicat Premium Data Transfer

 Source Server         : 172root
 Source Server Type    : MySQL
 Source Server Version : 80403 (8.4.3)
 Source Host           : 172.16.1.10:3306
 Source Schema         : starwrit

 Target Server Type    : MySQL
 Target Server Version : 80403 (8.4.3)
 File Encoding         : 65001

 Date: 24/04/2025 18:13:26
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for blog_menu
-- ----------------------------
DROP TABLE IF EXISTS `blog_menu`;
CREATE TABLE `blog_menu`  (
  `id` bigint NOT NULL COMMENT 'menuId',
  `pid` bigint NOT NULL DEFAULT 0 COMMENT '上级ID',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目录名',
  `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '描述',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '图标',
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '标签',
  `background` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '背景',
  `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
  `read` int NOT NULL DEFAULT 0 COMMENT '阅读量',
  `like` int NOT NULL DEFAULT 0 COMMENT '喜欢',
  `public` tinyint NOT NULL DEFAULT 1 COMMENT '公开',
  `deleted` tinyint NOT NULL DEFAULT 0 COMMENT '删除',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建者',
  `updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `deleted_at` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '删除时间',
  `created_by` bigint NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unique_checkname`(`pid` ASC, `name` ASC, `deleted_at` ASC) USING BTREE COMMENT '重名',
  INDEX `name`(`name` ASC) USING BTREE COMMENT '名称搜索优化',
  INDEX `create_at`(`created_at` ASC) USING BTREE COMMENT '创建人搜索优化'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of blog_menu
-- ----------------------------

SET FOREIGN_KEY_CHECKS = 1;
