ALTER TABLE `zh_sum_load_history`
ADD COLUMN `cover`  tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '覆盖数据' AFTER `load_time`;

CREATE TABLE `zh_pay_attachment` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tid` int(11) unsigned NOT NULL COMMENT '标段id',
  `sid` int(11) unsigned NOT NULL COMMENT '期id',
  `pid` int(11) NOT NULL COMMENT '合同支付id',
  `uid` int(11) unsigned NOT NULL COMMENT '用户id',
  `filename` varchar(255) CHARACTER SET utf16 NOT NULL COMMENT '文件名',
  `fileext` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件后缀',
  `filesize` varchar(30) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件大小',
  `filepath` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '文件存储路径',
  `in_time` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `renew` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否审批通过后上传',
  `username` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '用户名',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `zh_change_audit_list` ADD `mx_id` VARCHAR(50) NULL DEFAULT NULL COMMENT '计量单元id' AFTER `gcl_id`;

-- 估概预标准
INSERT INTO `calculation`.`zh_permission` (`id`, `name`, `controller`, `action`, `pid`, `icon_class`, `create_time`, `isshow`) VALUES ('72', '估概预标准', 'budget', 'all', '44', '', '0', '1');

ALTER TABLE `zh_project`
ADD COLUMN `budget`  varchar(100) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT '估概预标准-id列表(\',\'分隔)' AFTER `valuation`;

CREATE TABLE `zh_budget_std` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '估概预标准id',
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '名称',
  `gu_chapter_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '估算-项目节-id列表('',''分隔)',
  `gu_template_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '估算-新建模板-id列表('',''分隔)',
  `gai_chapter_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '概算-项目节-id列表('',''分隔)',
  `gai_template_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '概算-新建模板-id列表('',''分隔)',
  `yu_chapter_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '预算-项目节-id列表('',''分隔)',
  `yu_template_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '预算-新建模板-id列表('',''分隔)',
  `yu_bills_id` varchar(255) CHARACTER SET ascii NOT NULL DEFAULT '' COMMENT '预算-工程量清单-id列表('',''分隔)',
  `in_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='估概预标准列表';
