From 816333348a3d7abf9517d26147281d2cbbc8d37a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 29 Oct 2019 17:34:40 -0700 Subject: [PATCH] Upgrader - Drop table "civicrm_persistent" (unless it has data) --- CRM/Upgrade/Incremental/php/FiveTwenty.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CRM/Upgrade/Incremental/php/FiveTwenty.php b/CRM/Upgrade/Incremental/php/FiveTwenty.php index 6e63638be4..e8bc169442 100644 --- a/CRM/Upgrade/Incremental/php/FiveTwenty.php +++ b/CRM/Upgrade/Incremental/php/FiveTwenty.php @@ -50,6 +50,13 @@ class CRM_Upgrade_Incremental_php_FiveTwenty extends CRM_Upgrade_Incremental_Bas // if ($rev == '5.12.34') { // $preUpgradeMessage .= '

' . ts('A new permission, "%1", has been added. This permission is now used to control access to the Manage Tags screen.', array(1 => ts('manage tags'))) . '

'; // } + if ($rev == '5.20.alpha1') { + if (CRM_Core_DAO::checkTableExists('civicrm_persistent') && CRM_Core_DAO::checkTableHasData('civicrm_persistent')) { + $preUpgradeMessage .= '
' . ts("WARNING: The table \"civicrm_persistent\" is flagged for removal because all official records show it being unused. However, the upgrader has detected data in this copy of \"civicrm_persistent\". Please report anything you can about the usage of this table. In the mean-time, the data will be preserved.", [ + 1 => 'https://civicrm.org/bug-reporting', + ]); + } + } } /** @@ -125,6 +132,7 @@ class CRM_Upgrade_Incremental_php_FiveTwenty extends CRM_Upgrade_Incremental_Bas 'relationship_end_date', ], ]); + $this->addTask('Clean up unused table "civicrm_persistent"', 'dropTableIfEmpty', 'civicrm_persistent'); } public static function templateStatus(CRM_Queue_TaskContext $ctx) { -- 2.25.1