N°1740 - Class Query invalid Datamodel - Attention: Setup mandatory when applying this (core datamodel migration)

This commit is contained in:
Eric
2018-11-13 11:18:10 +01:00
parent 63b08b0e70
commit f0e5128fb5
4 changed files with 97 additions and 8 deletions

View File

@@ -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