drds 分库表的创建速记

关键词 :dbpartition by hash(`INVESTOR_APPLY_ID`)  

格式 :dbpartition by hash(分库字段)

创建例子: 

CREATE TABLE `BB_JYLS_new` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`source_code` varchar(50) DEFAULT NULL,
`source_product_code` varchar(50) DEFAULT NULL,
`trans_type` int(11) DEFAULT NULL,
`trans_type_dec` varchar(50) DEFAULT NULL,
`trans_money` decimal(16,2) DEFAULT NULL,
`trans_name` varchar(50) DEFAULT NULL,
`trans_idcard` varchar(30) DEFAULT NULL,
`trans_date` date DEFAULT NULL,
`trans_payment` varchar(30) DEFAULT NULL,
`t_zp_match_detail_id` int(11) DEFAULT NULL COMMENT '匹配明细ID',
`loanee_apply_id` int(11) DEFAULT NULL COMMENT '借款工单ID',
`investor_apply_id` int(11) DEFAULT NULL COMMENT '理财工单ID',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=45676 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC dbpartition by hash(`INVESTOR_APPLY_ID`);

posted @ 2016-06-22 14:38  秋香姑娘请你不要紧张  阅读(1327)  评论(0编辑  收藏  举报