ALTER TABLE `cash_invoice` CHANGE `phone` `phone` varchar(50) NOT NULL;
ALTER TABLE `sys_workflow` ADD `js` text NOT NULL AFTER `name`;
ALTER TABLE `sys_workflow` ADD `css` text NOT NULL AFTER `js`;
ALTER TABLE `sys_workflowaction` ADD `js` text NOT NULL AFTER `linkages`;
ALTER TABLE `sys_workflowaction` ADD `css` text NOT NULL AFTER `js`;

DELETE FROM `sys_block` WHERE `source` = 'hr' AND `block` = 'salary';

ALTER TABLE `ameba_setting` CHANGE `taxRate` `taxRate` decimal(5, 2) unsigned NOT NULL;
ALTER TABLE `ameba_setting` CHANGE `reportNum` `reportNum` smallint(5) unsigned NOT NULL;
ALTER TABLE `cash_invoice` CHANGE `taxRate` `taxRate` tinyint(3) unsigned NOT NULL;
ALTER TABLE `cash_invoicedetail` CHANGE `taxRate` `taxRate` tinyint(3) unsigned NOT NULL;
ALTER TABLE `cash_voucher` CHANGE `serialNum` `serialNum` smallint(5) unsigned NOT NULL COMMENT '序号';
ALTER TABLE `cash_voucher` CHANGE `posted` `posted` tinyint(3) unsigned NOT NULL COMMENT '过账';
ALTER TABLE `cash_voucherdetail` CHANGE `entryID` `entryID` tinyint(3) unsigned NOT NULL COMMENT '分录序号';
ALTER TABLE `crm_orderfield` CHANGE `order` `order` tinyint(3) unsigned NOT NULL;
ALTER TABLE `crm_quotation` CHANGE `version` `version` smallint(5) unsigned NOT NULL DEFAULT '1';
ALTER TABLE `hr_salarydetail` CHANGE `salary` `salary` mediumint(8) unsigned NOT NULL;
ALTER TABLE `hr_salarycommission` CHANGE `salary` `salary` mediumint(8) unsigned NOT NULL;
ALTER TABLE `hr_tradecommission` CHANGE `trade` `trade` mediumint(8) unsigned NOT NULL;
ALTER TABLE `psi_batch` CHANGE `id` `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT;
ALTER TABLE `psi_orderproduct` CHANGE `version` `version` smallint(5) unsigned NOT NULL DEFAULT '1';
ALTER TABLE `psi_purchaseproduct` CHANGE `order` `order` mediumint(8) unsigned NOT NULL;
ALTER TABLE `sys_issue` CHANGE `customer` `customer` mediumint(8) unsigned NOT NULL;
ALTER TABLE `sys_issue` CHANGE `contact` `contact` mediumint(8) unsigned NOT NULL;
ALTER TABLE `sys_searchindex` CHANGE `objectID` `objectID` mediumint(8) unsigned NOT NULL;
ALTER TABLE `sys_effort` CHANGE `objectID` `objectID` mediumint(8) unsigned NOT NULL;
ALTER TABLE `oa_leave` CHANGE `level` `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_lieu` CHANGE `level` `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_overtime` CHANGE `level` `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_refund` CHANGE `level` `level` tinyint(3) unsigned NOT NULL;

UPDATE `sys_workflowfield` SET `control` = 'label',    `options` = '[]'   WHERE `field` = 'id'; 
UPDATE `sys_workflowfield` SET `control` = 'label',    `options` = '[]'   WHERE `field` = 'parent';
UPDATE `sys_workflowfield` SET `control` = 'select',   `options` = 'user' WHERE `field` = 'assignedTo';
UPDATE `sys_workflowfield` SET `control` = 'select'                       WHERE `field` = 'status';
UPDATE `sys_workflowfield` SET `control` = 'select'                       WHERE `field` = 'subStatus';
UPDATE `sys_workflowfield` SET `control` = 'select',   `options` = 'user' WHERE `field` = 'createdBy';
UPDATE `sys_workflowfield` SET `control` = 'datetime', `options` = '[]'   WHERE `field` = 'createdDate';
UPDATE `sys_workflowfield` SET `control` = 'select',   `options` = 'user' WHERE `field` = 'editedBy';
UPDATE `sys_workflowfield` SET `control` = 'datetime', `options` = '[]'   WHERE `field` = 'editedDate';
UPDATE `sys_workflowfield` SET `control` = 'select',   `options` = 'user' WHERE `field` = 'assignedBy';
UPDATE `sys_workflowfield` SET `control` = 'datetime', `options` = '[]'   WHERE `field` = 'assignedDate';
UPDATE `sys_workflowfield` SET `control` = 'radio',    `options` = '["\\u672a\\u5220\\u9664","\\u5df2\\u5220\\u9664"]' WHERE `field` = 'deleted';
