CREATE TABLE `di_project` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`project_code` varchar(32) NOT NULL COMMENT '项目编码',
`project_name` varchar(64) DEFAULT NULL COMMENT '项目名称',
`remark` varchar(256) DEFAULT NULL COMMENT '备注',
`creator` varchar(32) DEFAULT NULL COMMENT '创建人',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`editor` varchar(32) DEFAULT NULL COMMENT '修改人',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `project_code` (`project_code`)
) ENGINE=InnoDB COMMENT='数据集成-项目信息';
As we all know, out of order varchar type index is not friendly for B+ index.
For better performance, we need to replace them by primary key such as id. Introducing snowflake algorithm as our primary key generator is acceptable