ALTER TABLE `oa_attendstat` ADD `createdBy` varchar(30) NOT NULL;
ALTER TABLE `oa_attendstat` ADD `createdDate` datetime NOT NULL;
ALTER TABLE `oa_attendstat` ADD `editedBy` varchar(30) NOT NULL;
ALTER TABLE `oa_attendstat` ADD `editedDate` datetime NOT NULL;

ALTER TABLE `crm_resume` ADD `position` varchar(100) NOT NULL DEFAULT 'other' AFTER `dept`;

ALTER TABLE `sys_action` ADD `stage` varchar(20) NOT NULL AFTER `action`;

CREATE TABLE IF NOT EXISTS `crm_stageservice` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `customer` mediumint(8) unsigned NOT NULL COMMENT '关联客户',
  `contract` mediumint(8) unsigned NOT NULL COMMENT '关联合同',
  `renewalIntention` varchar(10) NOT NULL COMMENT '续费意向',
  `M6Finished` tinyint(1) NOT NULL COMMENT '是否已完成M6满意度调查',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `crm_stagedelivery` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `customer` mediumint(8) unsigned NOT NULL COMMENT '关联客户',
  `contract` mediumint(8) unsigned NOT NULL COMMENT '关联合同',
  `date` datetime NOT NULL COMMENT '交付培训日期',
  `record` text NOT NULL COMMENT '交付培训记录',
  `health` varchar(10) NOT NULL COMMENT '客户应用健康度',
  `M1Finished` tinyint(1) NOT NULL COMMENT '是否完成M1满意度调查',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `crm_stagetrial` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `customer` mediumint(8) unsigned NOT NULL COMMENT '关联客户',
  `reply` text NOT NULL COMMENT '使用问题答疑',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `crm_stageguidance` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `customer` mediumint(8) unsigned NOT NULL,
  `materialFinished` tinyint(1) NOT NULL COMMENT '是否完成发送物料',
  `ourStaff` varchar(100) NOT NULL COMMENT '我方参与人员',
  `customerStaff` varchar(100) NOT NULL COMMENT '客户方参与人员',
  `record` text NOT NULL COMMENT '演示记录',
  `paymentIntention` varchar(10) NOT NULL COMMENT '客户付费意向度',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `crm_stagecommunication` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `customer` mediumint(8) unsigned NOT NULL,
  `scene` varchar(30) NOT NULL COMMENT '使用场景',
  `sceneOther` varchar(100) NOT NULL COMMENT '其他使用场景',
  `currentWay` varchar(30) NOT NULL COMMENT '目前管理方式',
  `currentWayOther` varchar(100) NOT NULL COMMENT '其他目前管理方式',
  `expect` text NOT NULL COMMENT '执行层期望解决的其他问题',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
