
ALTER TABLE `zh_stage`
ADD COLUMN `im_start_num`  int(11) NOT NULL DEFAULT 1 AFTER `im_gather_node`;

-- 安全生产
CREATE TABLE `zh_stage_safe_prod` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `tid` int(11) unsigned NOT NULL COMMENT '标段id',
  `sid` int(11) unsigned NOT NULL COMMENT '期id',
  `sorder` tinyint(4) unsigned NOT NULL COMMENT '期序号',
  `uuid` varchar(36) CHARACTER SET ascii NOT NULL COMMENT '安全生产标识id',
  `add_sid` int(11) unsigned NOT NULL COMMENT '新增期id',
  `add_uid` int(11) NOT NULL COMMENT '新增人id',
  `add_time` datetime NOT NULL COMMENT '新增时间',
  `order` int(11) unsigned NOT NULL COMMENT '排序',
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '名称',
  `unit` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '单位',
  `unit_price` decimal(24,8) DEFAULT NULL COMMENT '单价',
  `quantity` decimal(24,8) DEFAULT NULL COMMENT '计划-数量',
  `total_price` decimal(24,8) DEFAULT NULL COMMENT '计划-金额',
  `qty` decimal(24,8) DEFAULT NULL COMMENT '本期-数量',
  `tp` decimal(24,8) DEFAULT NULL COMMENT '本期-金额',
  `shistory` text CHARACTER SET utf8 COMMENT '本期历史数据',
  `pre_used` tinyint(4) DEFAULT '0' COMMENT '往期是否使用',
  `memo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- 临时占地
CREATE TABLE `zh_stage_temp_land` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `tid` int(11) unsigned NOT NULL COMMENT '标段id',
  `sid` int(11) unsigned NOT NULL COMMENT '期id',
  `sorder` tinyint(4) unsigned NOT NULL COMMENT '期序号',
  `uuid` varchar(36) CHARACTER SET ascii NOT NULL COMMENT '安全生产标识id',
  `add_sid` int(11) unsigned NOT NULL COMMENT '新增期id',
  `add_uid` int(11) NOT NULL COMMENT '新增人id',
  `add_time` datetime NOT NULL COMMENT '新增时间',
  `order` int(11) unsigned NOT NULL COMMENT '排序',
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '名称',
  `unit` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '单位',
  `unit_price` decimal(24,8) DEFAULT NULL COMMENT '单价',
  `qty` decimal(24,8) DEFAULT NULL COMMENT '本期-数量',
  `tp` decimal(24,8) DEFAULT NULL COMMENT '本期-金额',
  `shistory` text CHARACTER SET utf8 COMMENT '本期历史数据',
  `pre_used` tinyint(4) DEFAULT '0' COMMENT '往期是否使用',
  `memo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

