mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°1740 - Class Query invalid Datamodel - Attention: Setup mandatory when applying this (core datamodel migration)
This commit is contained in:
@@ -565,9 +565,19 @@ class ApplicationInstaller
|
||||
}
|
||||
}
|
||||
|
||||
protected static function DoUpdateDBSchema(
|
||||
$aSelectedModules, $sModulesDir, $aParamValues, $sTargetEnvironment = '', $bOldAddon = false, $sAppRootUrl = ''
|
||||
)
|
||||
/**
|
||||
* @param $aSelectedModules
|
||||
* @param $sModulesDir
|
||||
* @param $aParamValues
|
||||
* @param string $sTargetEnvironment
|
||||
* @param bool $bOldAddon
|
||||
* @param string $sAppRootUrl
|
||||
*
|
||||
* @throws \ConfigException
|
||||
* @throws \CoreException
|
||||
* @throws \MySQLException
|
||||
*/
|
||||
protected static function DoUpdateDBSchema($aSelectedModules, $sModulesDir, $aParamValues, $sTargetEnvironment = '', $bOldAddon = false, $sAppRootUrl = '')
|
||||
{
|
||||
SetupPage::log_info("Update Database Schema for environment '$sTargetEnvironment'.");
|
||||
$sMode = $aParamValues['mode'];
|
||||
@@ -588,6 +598,9 @@ class ApplicationInstaller
|
||||
$oProductionEnv = new RunTimeEnvironment($sTargetEnvironment);
|
||||
$oProductionEnv->InitDataModel($oConfig, true); // load data model only
|
||||
|
||||
// Migrate columns
|
||||
self::MoveColumns($sDBPrefix);
|
||||
|
||||
// Migrate application data format
|
||||
//
|
||||
// priv_internalUser caused troubles because MySQL transforms table names to lower case under Windows
|
||||
@@ -743,6 +756,18 @@ class ApplicationInstaller
|
||||
SetupPage::log_info("Database Schema Successfully Updated for environment '$sTargetEnvironment'.");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sDBPrefix
|
||||
*
|
||||
* @throws \CoreException
|
||||
* @throws \MySQLException
|
||||
*/
|
||||
protected static function MoveColumns($sDBPrefix)
|
||||
{
|
||||
// In 2.6.0 the 'fields' attribute has been moved from Query to QueryOQL for dependencies reasons
|
||||
ModuleInstallerAPI::MoveColumnInDB($sDBPrefix.'priv_query', 'fields', $sDBPrefix.'priv_query_oql', 'fields');
|
||||
}
|
||||
|
||||
protected static function AfterDBCreate(
|
||||
$sModulesDir, $aParamValues, $sAdminUser, $sAdminPwd, $sAdminLanguage, $aSelectedModules, $sTargetEnvironment,
|
||||
$bOldAddon
|
||||
|
||||
Reference in New Issue
Block a user