From 355a0c3fe2199c14a9a5d9b9a94b784b84ee4633 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 14 Apr 2023 13:08:28 -0700 Subject: [PATCH] Upgrader - Reinstate step "4.7.32" (which was actually released as part of "5.0") --- CRM/Upgrade/Form.php | 2 +- CRM/Upgrade/Incremental/php/FourSeven.php | 61 ++++++++++++++++++++ CRM/Upgrade/Incremental/sql/4.7.32.mysql.tpl | 14 +++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 CRM/Upgrade/Incremental/php/FourSeven.php create mode 100644 CRM/Upgrade/Incremental/sql/4.7.32.mysql.tpl diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 1b7c110ceb..902e5afbf5 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -25,7 +25,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { /** * Minimum previous CiviCRM version we can directly upgrade from */ - const MINIMUM_UPGRADABLE_VERSION = '4.7.32'; + const MINIMUM_UPGRADABLE_VERSION = '4.7.31'; /** * @var \CRM_Core_Config diff --git a/CRM/Upgrade/Incremental/php/FourSeven.php b/CRM/Upgrade/Incremental/php/FourSeven.php new file mode 100644 index 0000000000..982e761c8b --- /dev/null +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@ -0,0 +1,61 @@ +' . ts('A new %1 permission has been added. It is not granted by default. If you use SMS, you may wish to review your permissions.', [1 => 'send SMS']) . '

'; + } + } + + /** + * Compute any messages which should be displayed after upgrade. + * + * @param string $postUpgradeMessage + * alterable. + * @param string $rev + * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs. + */ + public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { + } + + /** + * Upgrade function. + * + * NOTE: 4.7.31 was the last public release of 4.7.x. The version 4.7.32 indicates an internal step that was de-facto 5.0. + * + * @param string $rev + */ + public function upgrade_4_7_32($rev) { + $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev); + + $this->addTask('CRM-21733: Add status_override_end_date field to civicrm_membership table', 'addColumn', 'civicrm_membership', 'status_override_end_date', + "date DEFAULT NULL COMMENT 'The end date of membership status override if (Override until selected date) override type is selected.'"); + } + +} diff --git a/CRM/Upgrade/Incremental/sql/4.7.32.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.32.mysql.tpl new file mode 100644 index 0000000000..b542246f42 --- /dev/null +++ b/CRM/Upgrade/Incremental/sql/4.7.32.mysql.tpl @@ -0,0 +1,14 @@ +{* file to handle db changes in 4.7.32 during upgrade *} + +-- CRM-21837 - Missing states for Gabon +SELECT @country_id := id from civicrm_country where name = 'Gabon' AND iso_code = 'GA'; +INSERT IGNORE INTO `civicrm_state_province` (`id`, `country_id`, `abbreviation`, `name`) VALUES +(NULL, @country_id, "01", "Estuaire"), +(NULL, @country_id, "02", "Haut-Ogooué"), +(NULL, @country_id, "03", "Moyen-Ogooué"), +(NULL, @country_id, "04", "Ngounié"), +(NULL, @country_id, "05", "Nyanga"), +(NULL, @country_id, "06", "Ogooué-Ivindo"), +(NULL, @country_id, "07", "Ogooué-Lolo"), +(NULL, @country_id, "08", "Ogooué-Maritime"), +(NULL, @country_id, "09", "Woleu-Ntem"); -- 2.25.1