ALTER TABLE `zh_project_account` ADD `qywx_corpid` VARCHAR(255) NULL DEFAULT NULL COMMENT '已绑定的企业微信id' AFTER `wx_name`;
ALTER TABLE `zh_project_account` ADD `qywx_userid` VARCHAR(255) NULL DEFAULT NULL COMMENT '已绑定企业微信用户id' AFTER `qywx_corpid`;
ALTER TABLE `zh_project_account` ADD `qywx_user_info` VARCHAR(1000) NULL DEFAULT NULL COMMENT '已绑定的企业微信用户信息' AFTER `qywx_userid`;

CREATE TABLE `zh_wx_work` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agentid` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '应用id',
  `corpid` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '企业id',
  `corp_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '企业名称',
  `permanent_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT '企业secret',
  `auth_user_info` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '授权人信息json',
  `in_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `corpid` (`corpid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='企业微信信息表';

ALTER TABLE `zh_stage_import_change`
ADD COLUMN `rela_minus`  tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否负变更' AFTER `rela_qty`,
ADD COLUMN `rela_no_value`  tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否不计价' AFTER `rela_minus`,
ADD COLUMN `unit_price`  decimal(24,8) NOT NULL DEFAULT 0.00000000 COMMENT '清单单价' AFTER `rela_no_value`;

CREATE TABLE `zh_global_log` (
  `id` varchar(36) COLLATE utf8_unicode_ci NOT NULL COMMENT 'id',
  `project_id` int(11) unsigned NOT NULL DEFAULT '0',
  `project_code` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0',
  `user_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `url` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `method` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_response` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '是否返回数据',
  `run_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '运行时长，毫秒',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

ALTER TABLE `zh_project` ADD `after_login_url` VARCHAR(255) NULL DEFAULT NULL COMMENT '登录后跳转页url' AFTER `can_api`;
