drop table if exists cp_knowledge_tree;

CREATE TABLE `cp_knowledge_tree` (
  `id` varchar(32) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '主键',
  `node_name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '节点名称',
  `memo` varchar(300) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '描述',
  `level_no` int(2) DEFAULT NULL COMMENT '层级',
  `idx` int(3) DEFAULT NULL COMMENT '顺序',
  `parent_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '父节点',
  `path` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'id路径',
  `is_leaf` tinyint(4) DEFAULT NULL COMMENT '叶子节点',
  `is_deleted` tinyint(4) DEFAULT NULL COMMENT '是否删除',
  `created_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '创建人',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '修改人',
  `updated_time` datetime DEFAULT NULL COMMENT '修改时间',
  `tenant_id` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='知识库树目录';