ADD COLUMN `full_path` VARCHAR(200) NULL AFTER `create_time`,
ADD COLUMN `directory_id` VARCHAR(45) NULL AFTER `full_path`;
ALTER TABLE `api_info_history`
ADD COLUMN `full_path` VARCHAR(200) NULL AFTER `create_time`,
ADD COLUMN `directory_id` VARCHAR(45) NULL AFTER `full_path`;
CREATE TABLE `api_directory` (
`id` varchar(45) NOT NULL,
`name` varchar(45) DEFAULT NULL,
`path` varchar(200) DEFAULT NULL,
`parent_id` varchar(20) DEFAULT NULL,
`service` varchar(45) DEFAULT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
insert into api_directory(id,service,name) select md5(uuid()),service,group_name from api_info group by service,group_name;
SET SQL_SAFE_UPDATES = 0;
update api_info set full_path=path where 1=1;
update api_info t1 set directory_id = (select id from api_directory t2 where t1.group_name = t2.name) ;
update api_info_history set full_path=path where 1=1;
update api_info_history t1 set directory_id = (select id from api_directory t2 where t1.group_name = t2.name) ;
DROP COLUMN `group_name`;
ALTER TABLE `api_info_history`
DROP COLUMN `group_name`;