1. 程式人生 > >mysql的建表語句

mysql的建表語句

status 更新 sql div amp time creat prim tiny

CREATE TABLE `delivery_id_pool` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT ‘自增id‘,
  `delivery_id` varchar(100) NOT NULL COMMENT ‘運單號‘,
  `status` tinyint(1) DEFAULT ‘1‘ COMMENT ‘狀態[1:已使用,0:未使用]‘,
  `batch_id` int(11) DEFAULT NULL COMMENT ‘批次號‘,
  `create_time` datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00‘ COMMENT ‘創建時間‘,
  `update_time` datetime DEFAULT NULL COMMENT 
‘更新時間‘, `yn` tinyint(1) DEFAULT ‘1‘ COMMENT ‘是否有效‘, `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘時間戳‘, PRIMARY KEY (`id`,`create_time`), KEY `idx_delivery_id` (`delivery_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2646421 DEFAULT CHARSET=utf8 COMMENT=‘運單號緩存池表-手工生成運單號‘ ;

mysql的建表語句