From e87b39f4132354cab9565b8e975fe442e2855c84 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 15 Aug 2017 07:03:08 +1000 Subject: [PATCH] CRM-20927 Migrate Upgrade code from mysql.tpl to PHP for saftey and stability --- CRM/Upgrade/Incremental/php/FourSeven.php | 12 ++++++++++++ CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php index a549ee5acd..cdfabab9ee 100644 --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -404,6 +404,18 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev); } + /** + * Upgrade function. + * + * @param string $rev + */ + public function upgrade_4_7_25($rev) { + $this->addTask('CRM-20927 - Add Generic Column for other data', 'addColumn', + 'civicrm_menu', 'module_data', "text COMMENT 'All other menu metadata not stored in other fields'"); + $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev); + } + + /* * Important! All upgrade functions MUST add a 'runSql' task. * Uncomment and use the following template for a new upgrade version diff --git a/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl index b3dff73dcb..f0c2f50ff1 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.25.mysql.tpl @@ -1,7 +1,4 @@ {* file to handle db changes in 4.7.25 during upgrade *} -ALTER TABLE `civicrm_menu` -ADD COLUMN `module_data` text COMMENT 'All other menu metadata not stored in other fields'; - --CRM-21061 Increase report_id size from 64 to 512 to match civicrm_option_value.value column ALTER TABLE civicrm_report_instance CHANGE COLUMN report_id report_id varchar(512) COMMENT 'FK to civicrm_option_value for the report template'; -- 2.25.1