ALTER TABLE `zh_project`
ADD COLUMN `common_json` json NULL COMMENT '通用json，没有sql查询值必要的可放这' AFTER `notice_setting`;
ALTER TABLE `zh_ledger_tag`
ADD COLUMN `pos_id` varchar(36) NOT NULL DEFAULT '' COMMENT '关联计量单元id(zh_pos表中的id)' AFTER `id`;

ALTER TABLE `zh_change`
ADD COLUMN `valuation_tp` decimal(30, 8) NULL DEFAULT 0 COMMENT '计价金额(审批完成后统计)' AFTER `negative_tp`,
ADD COLUMN `unvaluation_tp` decimal(30, 8) NULL DEFAULT 0 COMMENT '不计价金额(审批完成后统计)' AFTER `valuation_tp`;

ALTER TABLE `zh_change`
MODIFY COLUMN `positive_tp` decimal(30, 8) NOT NULL DEFAULT 0.00000000 COMMENT '正变更金额' AFTER `order_by`,
MODIFY COLUMN `negative_tp` decimal(30, 8) NOT NULL DEFAULT 0.00000000 COMMENT '负变更金额' AFTER `positive_tp`,

ALTER TABLE `zh_ledger_attachment`
MODIFY COLUMN `tid` int(11) UNSIGNED NOT NULL COMMENT '标段id' AFTER `id`,
ADD COLUMN `revise_id` varchar(36) NOT NULL COMMENT '修订id' AFTER `tid`,
ADD COLUMN `revising` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '修订中' AFTER `rid`,
MODIFY COLUMN `uid` int(11) UNSIGNED NOT NULL COMMENT '上传者id' AFTER `lid`,
ADD COLUMN `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间' AFTER `in_time`;

ALTER TABLE `zh_ledger_attachment`
ADD INDEX `idx_tid`(`tid`),
ADD INDEX `idx_tid_sid`(`tid`, `settle_id`),
ADD INDEX `idx_tid_rid`(`tid`, `revise_id`),
ADD INDEX `idx_tid_revising`(`tid`, `revising`);
