Merge branch 'sgm_upgrade' into 'master'

Sgm upgrade

See merge request easycorp/zentaopms!2177
This commit is contained in:
朱金勇
2022-03-10 02:30:28 +00:00
2 changed files with 6 additions and 7 deletions
+1
View File
@@ -68,3 +68,4 @@ ALTER TABLE `zt_bug` ADD `entry` varchar(255) COLLATE 'utf8_general_ci' NOT NULL
ALTER TABLE `zt_repobranch` ADD INDEX `revision` (`revision`);
DELETE FROM `zt_grouppriv` WHERE `module` = 'api' AND `method` = 'sql';
REPLACE INTO `zt_config` set `owner` = 'system', `module` = 'common', `section` = 'global', `key` = 'showAnnual', `value` = '1';
+5 -7
View File
@@ -34,10 +34,9 @@ class upgradeModel extends model
* @access public
* @return array
*/
public function getVersionsToUpdate($openVersion)
public function getVersionsToUpdate($openVersion, $fromEdition)
{
$versions = array();
$edition = $this->config->edition;
/* Always update open. */
foreach($this->lang->upgrade->fromVersions as $version => $versionName)
@@ -46,21 +45,21 @@ class upgradeModel extends model
if(version_compare(str_replace('_', '.', $version), str_replace('_', '.', $openVersion)) < 0) continue;
$versions[$version] = array('pro' => array(), 'biz' => array(), 'max' => array());
}
if($edition == 'open') return $versions;
if($fromEdition == 'open') return $versions;
/* Update to pro|biz|max. */
foreach($this->config->upgrade->proVersion as $pro => $open)
{
if(isset($versions[$open])) $versions[$open]['pro'][] = $pro;
}
if($edition == 'pro') return $versions;
if($fromEdition == 'pro') return $versions;
/* Update to biz|max. */
foreach($this->config->upgrade->bizVersion as $biz => $open)
{
if(isset($versions[$open])) $versions[$open]['biz'][] = $biz;
}
if($edition != 'max') return $versions;
if($fromEdition == 'biz') return $versions;
/* Update to max. */
foreach($this->config->upgrade->maxVersion as $max => $open)
@@ -90,7 +89,7 @@ class upgradeModel extends model
/* Execute. */
$fromOpenVersion = is_numeric($fromVersion[0]) ? $fromVersion : $this->config->upgrade->{$fromEdition . 'Version'}[$fromVersion];
$versions = $this->getVersionsToUpdate($fromOpenVersion);
$versions = $this->getVersionsToUpdate($fromOpenVersion, $fromEdition);
foreach($versions as $openVersion => $chargedVersions)
{
$executeXuanxuan = false;
@@ -354,7 +353,6 @@ class upgradeModel extends model
break;
case '11_7':
$this->adjustPriv12_0();
$this->loadModel('setting')->setItem('system.common.global.showAnnual', '1');
break;
case '12_0_1':
$this->importRepoFromConfig();