 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `categories` (
-  `id` int(10) NOT NULL AUTO_INCREMENT,
-  `parent_id` int(10) NOT NULL,
-  `code` varchar(16) CHARACTER SET utf8 NOT NULL,
-  `name` varchar(255) CHARACTER SET utf8 NOT NULL,
-  `name_chinese` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
-  `lft` int(10) NOT NULL,
-  `rght` int(10) NOT NULL,
-  PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1716 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主索引',
+  `parent_id` int(10) NOT NULL COMMENT '父分類',
+  `code` varchar(16) CHARACTER SET utf8 NOT NULL COMMENT '分類代碼',
+  `name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '原文名稱',
+  `name_chinese` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '中文名稱',
+  `lft` int(10) NOT NULL COMMENT '左索引',
+  `rght` int(10) NOT NULL COMMENT '右索引',
+  PRIMARY KEY (`id`),
+  KEY `lft` (`lft`,`rght`)
+) ENGINE=InnoDB AUTO_INCREMENT=4044 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `drugs` (
  `id` binary(36) NOT NULL,
  `license_uuid` binary(36) NOT NULL,
  `license_id` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT '許可證字號',
  `cancel_status` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '註銷狀態',
  `cancel_date` date DEFAULT NULL COMMENT '註銷日期',

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categories_licenses` (
  `id` binary(36) NOT NULL COMMENT '主索引',
  `category_id` int(10) NOT NULL COMMENT '分類索引',
  `license_id` binary(36) NOT NULL COMMENT '藥證索引',
  `type` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分類類型',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
