– 建表语句
CREATE TABLE ieg_operation_promotion_project_sequence_cc
(
id
int NOT NULL AUTO_INCREMENT COMMENT ‘主键id’,
code
varchar(64) DEFAULT NULL COMMENT ‘项目编码’,
PRIMARY KEY (id
) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=1000001 /*T![auto_id_cache] AUTO_ID_CACHE=1 */ COMMENT=‘CC’;
创建表后插入带主键数据
INSERT INTO ieg_operation_promotion_project_sequence_cc
(id,code)
VALUES(1000001, ‘D0324001’);
使用dbeaver连接工具创建以及查看
建表后插入正常,第二天查看ddl
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=1008001 /*T![auto_id_cache] AUTO_ID_CACHE=1 */
AUTO_INCREMENT 跳号,并且按照4000缓存递增
需要主键id单调自增连续