ALTER TABLE `zh_tender`
ADD COLUMN `has_rela`  tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否有关联台账' AFTER `had_map`;

CREATE TABLE `NewTable` (
`id`  int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id' ,
`tid`  int(11) UNSIGNED NOT NULL COMMENT '标段id' ,
`sid`  int(11) UNSIGNED NOT NULL COMMENT '期id' ,
`sorder`  tinyint(4) UNSIGNED NOT NULL COMMENT '期序号' ,
`rela_tid`  int(11) UNSIGNED NOT NULL COMMENT '关联标段id' ,
`rela_sid`  int(11) UNSIGNED NOT NULL COMMENT '关联期id' ,
`rela_sorder`  tinyint(4) UNSIGNED NOT NULL COMMENT '关联期序号' ,
`add_time`  datetime NOT NULL COMMENT '添加时间' ,
`update_time`  datetime NOT NULL COMMENT '更新时间' ,
`total_price`  decimal(28,6) NULL ,
`cache_tp`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '缓存金额(当前标段单价计算)' ,
`cache_org_tp`  text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '缓存金额(原关联标段单价计算)' ,
PRIMARY KEY (`id`)
)
COMMENT='计量期-关联台账（含缓存数据）'
;