ALTER TABLE activity RENAME TO sp_activity;
ALTER TABLE activitydetail RENAME TO sp_activity_detail;
ALTER TABLE activitymaterial RENAME TO sp_activity_material;
ALTER TABLE SPMsgTemplate RENAME TO sp_spmsg_template;
ALTER TABLE approve RENAME TO sp_approve;
ALTER TABLE approve_detail RENAME TO sp_approve_detail;
ALTER TABLE approvehistory RENAME TO sp_approve_history;
ALTER TABLE approverole RENAME TO sp_approve_role;
ALTER TABLE config RENAME TO config_system;
ALTER TABLE activityContractor RENAME TO sp_activity_contractor;
ALTER TABLE filesynclog RENAME TO log_filesync;
ALTER TABLE message RENAME TO sp_message;
ALTER TABLE primarynotice RENAME TO sp_csmsg_template;
ALTER TABLE region RENAME TO base_region;
ALTER TABLE serviceorg RENAME TO base_serviceorg;
ALTER TABLE slmsgtemplate RENAME TO sp_slmsg_template;
ALTER TABLE survey RENAME TO sp_activity_survey;
ALTER TABLE surveyinfo RENAME TO sp_activity_survey_detail;
ALTER TABLE synctask RENAME TO sp_sync_task;
ALTER TABLE systemlog RENAME TO log_system;
ALTER TABLE user RENAME TO sp_se_user;
ALTER TABLE userloginlog RENAME TO log_user_login;
ALTER TABLE workflow RENAME TO sp_workflow;


ALTER TABLE `base_region`
CHANGE COLUMN `level` `regionLevel` int(11) NULL DEFAULT NULL AFTER `id`,
CHANGE COLUMN `name` `fullName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `regionLevel`;

ALTER TABLE `config_system`
CHANGE COLUMN `key` `sysKey` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `id`,
CHANGE COLUMN `value` `sysValue` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `sysKey`;

ALTER TABLE `sp_activity`
CHANGE COLUMN `name` `fullName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `pssId`;

ALTER TABLE `sp_activity_contractor`
CHANGE COLUMN `name` `fullName` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `activityId`;

ALTER TABLE `sp_activity_history`
CHANGE COLUMN `name` `fullName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '活动名称' AFTER `updateTime`;

ALTER TABLE `sp_approve_history`
CHANGE COLUMN `reset` `isReset` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `approveId`;

ALTER TABLE `sp_approve_role`
CHANGE COLUMN `name` `fullName` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `id`;

ALTER TABLE `sp_workflow`
CHANGE COLUMN `name` `fullName` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `seq`;

ALTER TABLE `sp_workflow`
DROP COLUMN `options`;


update sp_se_user set role = 'SUPERADMIN' where username = 'admin';
delete from config_system where `syskey` = 'default-province';
delete from config_system where `syskey` = 'third-party-auth';
delete from config_system where `syskey` = 'transfer-type';
delete from config_system where `syskey` = 'transfer-path';
delete from config_system where `syskey` = 'approve-path';
delete from config_system where `syskey` = 'local-code';
delete from config_system where `syskey` = 'default-city';

update sp_se_user set role = 'SUPERADMIN' where username = 'admin';
update sp_se_user set role = 'APPROVE' where role = 'COMMON';

ALTER TABLE `sp_activity_survey_detail`
MODIFY COLUMN `opinion` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `pssInfoId`,
MODIFY COLUMN `solve` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `opinion`,
MODIFY COLUMN `opinionPic` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `solve`,
MODIFY COLUMN `solvePic` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `opinionPic`;

#各地市
insert into config_system(`syskey`,`sysvalue`) values ('spjg_folder','hangzhouspjg');