From 21c77685bb10c769510d316156ef2e5eae1f109e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 9 Mar 2015 11:35:42 +0800 Subject: [PATCH] * change for upgrade. --- VERSION | 2 +- config/config.php | 2 +- db/update7.0.sql | 2 -- db/zentao.sql | 39 +++++++++++++++++++++++++++++++++++ module/upgrade/lang/en.php | 1 + module/upgrade/lang/zh-cn.php | 1 + module/upgrade/model.php | 3 +++ 7 files changed, 46 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 81c071ef54..4c5da91693 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0.stable +7.1.stable diff --git a/config/config.php b/config/config.php index 3b810f72df..2d732e4b59 100644 --- a/config/config.php +++ b/config/config.php @@ -17,7 +17,7 @@ if(!function_exists('getWebRoot')){function getWebRoot(){}} /* Basic settings. */ $config = new config(); -$config->version = '7.0'; // The version of zentaopms. Don't change it. +$config->version = '7.1'; // The version of zentaopms. Don't change it. $config->charset = 'UTF-8'; // The charset of zentaopms. $config->cookieLife = time() + 2592000; // The cookie life time. $config->timezone = 'Asia/Shanghai'; // The time zone setting, for more see http://www.php.net/manual/en/timezones.php diff --git a/db/update7.0.sql b/db/update7.0.sql index 8970ce7386..c7d44912f9 100644 --- a/db/update7.0.sql +++ b/db/update7.0.sql @@ -1,5 +1,3 @@ -REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'global', 'cron', '0'); - DROP TABLE IF EXISTS `zt_cron`; CREATE TABLE `zt_cron` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, diff --git a/db/zentao.sql b/db/zentao.sql index 391d84238d..36c3cc9b0c 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -156,6 +156,22 @@ CREATE TABLE IF NOT EXISTS `zt_config` ( PRIMARY KEY (`id`), UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_cron`; +CREATE TABLE IF NOT EXISTS `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_lang`; CREATE TABLE IF NOT EXISTS `zt_lang` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -288,6 +304,20 @@ CREATE TABLE IF NOT EXISTS `zt_history` ( `diff` mediumtext NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_mailqueue`; +CREATE TABLE IF NOT EXISTS `zt_mailqueue` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `toList` varchar(255) NOT NULL, + `ccList` varchar(255) NOT NULL, + `subject` varchar(255) NOT NULL, + `body` text NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_module`; CREATE TABLE IF NOT EXISTS `zt_module` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -630,6 +660,15 @@ CREATE TABLE IF NOT EXISTS `zt_usertpl` ( KEY `account` (`account`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES +('*', '*', '*', '*', '*', '', '监控定时任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('30', '23', '*', '*', '*', 'moduleName=project&methodName=computeburn', '更新燃尽图', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('0', '1', '*', '*', '*', 'moduleName=report&methodName=remind', '每日任务提醒', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('*/5', '*', '*', '*', '*', 'moduleName=svn&methodName=run', '同步SVN', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('*/5', '*', '*', '*', '*', 'moduleName=git&methodName=run', '同步GIT', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('30', '0', '*', '*', '*', 'moduleName=backup&methodName=backup', '备份数据和附件', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('*/5', '*', '*', '*', '*', 'moduleName=mail&methodName=asyncSend', '异步发信', 'zentao', 1, 'normal', '0000-00-00 00:00:00'); + INSERT INTO `zt_group` (`id`, `name`, `role`, `desc`) VALUES (1, 'ADMIN', 'admin', 'for administrator'), (2, 'DEV', 'dev', 'for developers.'), diff --git a/module/upgrade/lang/en.php b/module/upgrade/lang/en.php index 193a6c5f22..3634d4a079 100644 --- a/module/upgrade/lang/en.php +++ b/module/upgrade/lang/en.php @@ -88,3 +88,4 @@ $lang->upgrade->fromVersions['6_1'] = '6.1'; $lang->upgrade->fromVersions['6_2'] = '6.2'; $lang->upgrade->fromVersions['6_3'] = '6.3'; $lang->upgrade->fromVersions['6_4'] = '6.4'; +$lang->upgrade->fromVersions['7_0'] = '7.0'; diff --git a/module/upgrade/lang/zh-cn.php b/module/upgrade/lang/zh-cn.php index a0f23cba01..7dd09bc9ef 100644 --- a/module/upgrade/lang/zh-cn.php +++ b/module/upgrade/lang/zh-cn.php @@ -88,3 +88,4 @@ $lang->upgrade->fromVersions['6_1'] = '6.1'; $lang->upgrade->fromVersions['6_2'] = '6.2'; $lang->upgrade->fromVersions['6_3'] = '6.3'; $lang->upgrade->fromVersions['6_4'] = '6.4'; +$lang->upgrade->fromVersions['7_0'] = '7.0'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 383ff9f5fc..1841a73750 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -114,6 +114,8 @@ class upgradeModel extends model $this->execSQL($this->getUpgradeFile('6.1')); case '6_2': case '6_3': + case '7_0': + $this->execSQL($this->getUpgradeFile('7.0')); default: if(!$this->isError()) $this->setting->updateVersion($this->config->version); } @@ -178,6 +180,7 @@ class upgradeModel extends model case '6_1': $confirmContent .= file_get_contents($this->getUpgradeFile('6.1')); case '6_2': case '6_3': + case '7_0': $confirmContent .= file_get_contents($this->getUpgradeFile('7.0')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); }