Skip to content
Snippets Groups Projects
Unverified Commit 79c1c047 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #25555 from seamuslee001/dev_core_4116

#4116 Add in rebuilding log table schema when modifying schema
parents 61a860a2 80e0083b
Branches
Tags
No related merge requests found
......@@ -225,7 +225,9 @@ class CRM_Upgrade_Incremental_Base {
// Hrm, `enable()` normally does these things... but not during upgrade...
// Note: A good test-scenario is to install 5.45; enable logging and CiviGrant; disable searchkit+afform; then upgrade to 5.47.
$schema = new CRM_Logging_Schema();
$schema->fixSchemaDifferences();
if ($schema->isEnabled()) {
$schema->fixSchemaDifferences();
}
CRM_Core_Invoke::rebuildMenuAndCaches(FALSE, FALSE);
// sessionReset is FALSE because upgrade status/postUpgradeMessages are needed by the page. We reset later in doFinish().
......@@ -299,6 +301,10 @@ class CRM_Upgrade_Incremental_Base {
foreach ($queries as $query) {
CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE);
}
$schema = new CRM_Logging_Schema();
if ($schema->isEnabled()) {
$schema->fixSchemaDifferencesFor($table);
}
}
if ($locales && $triggerRebuild) {
CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales, $version, TRUE);
......@@ -517,6 +523,10 @@ class CRM_Upgrade_Incremental_Base {
CRM_Core_DAO::executeQuery("ALTER TABLE `$table` DROP COLUMN `$column`",
[], TRUE, NULL, FALSE, FALSE);
}
$schema = new CRM_Logging_Schema();
if ($schema->isEnabled()) {
$schema->fixSchemaDifferencesFor($table);
}
return TRUE;
}
......@@ -599,6 +609,10 @@ class CRM_Upgrade_Incremental_Base {
foreach ($queries as $query) {
CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE);
}
$schema = new CRM_Logging_Schema();
if ($schema->isEnabled()) {
$schema->fixSchemaDifferencesFor($table);
}
return TRUE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment