From 38a9c6531ff336f4efb012bf7d70ff62b66250f2 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 2 Oct 2017 11:49:02 +1100 Subject: [PATCH] CRM-20769 Rebuild multilingual structure based on DAOs after adding columns to table --- CRM/Upgrade/Incremental/Base.php | 15 +++++++++++++++ CRM/Upgrade/Incremental/php/FourSeven.php | 1 + 2 files changed, 16 insertions(+) diff --git a/CRM/Upgrade/Incremental/Base.php b/CRM/Upgrade/Incremental/Base.php index 1120cdafed..00edb0c190 100644 --- a/CRM/Upgrade/Incremental/Base.php +++ b/CRM/Upgrade/Incremental/Base.php @@ -228,4 +228,19 @@ class CRM_Upgrade_Incremental_Base { return TRUE; } + /** + * Rebuild Multilingual Schema. + * @param CRM_Queue_TaskContext $ctx + * @return bool + */ + public static function rebuildMultilingalSchema($ctx) { + $domain = new CRM_Core_DAO_Domain(); + $domain->find(TRUE); + if ($domain->locales) { + $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales); + CRM_Core_I18n_Schema::rebuildMultilingualSchema($locales); + } + return TRUE; + } + } diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index 500da9045d..53cf0f843c 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -427,6 +427,7 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base 'civicrm_case', 'created_date', "timestamp NULL DEFAULT NULL COMMENT 'When was the case was created.'"); $this->addTask('CRM-20958 - Add modified_date to civicrm_case', 'addColumn', 'civicrm_case', 'modified_date', "timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When was the case (or closely related entity) was created or modified or deleted.'"); + $this->addTask('Rebuild Multilingual Schema', 'rebuildMultilingalSchema'); } -- 2.25.1