chenshun00
2021-08-04 09:03:20 +08:00
```mysql
CREATE TABLE `test_table` (
`action` varchar(64) NOT NULL,
`projectId` int(11) NOT NULL COMMENT 'yapi 项目 ID',
`projectName` varchar(32) NOT NULL COMMENT '项目名字',
`catId` int(11) NOT NULL COMMENT 'API 分类 ID',
`catName` varchar(64) NOT NULL COMMENT 'API 分类名字',
`apiDesc` varchar(512) NOT NULL COMMENT 'API 分类描述',
`title` varchar(64) NOT NULL COMMENT 'API 标题',
`path` varchar(64) NOT NULL COMMENT 'http 请求路径',
`method` varchar(12) NOT NULL COMMENT 'api 请求方法',
`upTime` datetime NOT NULL DEFAULT '2020-01-01 00:00:00' ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`addTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`version` varchar(32) NOT NULL COMMENT '版本',
`status` varchar(16) NOT NULL COMMENT 'api 状态(上线 /下线)',
`fullinfo` text NOT NULL COMMENT 'API fullinfo 信息',
`visibility` tinyint(4) NOT NULL DEFAULT '0',
`session` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`action`),
KEY `test_table_projectId_catId_path_index` (`projectId`,`catId`,`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
```
desc select * from test_table where projectId = '11111' and catId >2 order by path;
key: test_table_projectId_catId_path_index
extra: Using index condition; Using filesort