MySQL 表公共字段

这里采用小写字段名及索引名

ALTER TABLE `table_name` 
ADD (
    `created_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '插入时间',
    `updated_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `deleted` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '逻辑删除',
    `version` INT(11) NOT NULL DEFAULT '0' COMMENT '版本号'
),
ADD INDEX `idx_created_time` (`created_time`), 
ADD INDEX `idx_updated_time` (`updated_time`), 
ADD INDEX `idx_deleted` (`deleted`);