Merge branch 'sgm_upgrade' into 'master'

* Fix upgrade bug.

See merge request easycorp/zentaopms!2230
This commit is contained in:
朱金勇
2022-03-14 06:36:24 +00:00
5 changed files with 3798 additions and 7 deletions
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -11,7 +11,7 @@ ALTER TABLE `zt_doc` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `id`;
ALTER TABLE `zt_doclib` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `type`;
ALTER TABLE `zt_action` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `read`;
ALTER TABLE `zt_searchindex` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `id`;
ALTER TABLE `zt_config` ADD `vision` varchar(10) NOT NULL DEFAULT '' AFTER `id`;
ALTER TABLE `zt_config` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `id`;
ALTER TABLE `zt_config` DROP INDEX `unique`, ADD UNIQUE `unique` (`vision`,`owner`,`module`,`section`,`key`);
ALTER TABLE `zt_todo` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `deleted`;
ALTER TABLE `zt_block` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `account`;
+1 -1
View File
@@ -359,7 +359,7 @@ CREATE TABLE IF NOT EXISTS `zt_compile` (
-- DROP TABLE IF EXISTS `zt_config`;
CREATE TABLE IF NOT EXISTS `zt_config` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`vision` varchar(10) NOT NULL DEFAULT '',
`vision` varchar(10) NOT NULL DEFAULT 'rnd',
`owner` char(30) NOT NULL default '',
`module` varchar(30) NOT NULL,
`section` char(30) NOT NULL default '',
+2 -1
View File
@@ -76,7 +76,8 @@ class customModel extends model
$item->key = $key;
$item->value = $value;
$item->system = $system;
$item->vision = $this->config->vision;
if(!defined('IN_UPGRADE')) $item->vision = $this->config->vision;
$this->dao->replace(TABLE_LANG)->data($item)->exec();
}
+3 -4
View File
@@ -51,8 +51,8 @@ class settingModel extends model
{
/* Determine vision of config item. */
$pathVision = explode('@', $path);
$vision = isset($pathVision[1]) ? $pathVision[1] : '';
$path = $pathVision[0];
$vision = isset($pathVision[1]) ? $pathVision[1] : '';
$path = $pathVision[0];
/* fix bug when account has dot. */
$account = isset($this->app->user->account) ? $this->app->user->account : '';
@@ -78,8 +78,7 @@ class settingModel extends model
$item->key = $key;
$item->value = $value;
/* If in upgrade, skip vision. */
if(!defined('IN_UPGRADE')) $item->vision = $vision;
if($vision) $item->vision = $vision;
$this->dao->replace(TABLE_CONFIG)->data($item)->exec();
}