From dce0a4a723196583dfe1baaa554ecdfdae00e299 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 14 Dec 2020 11:54:53 +1100 Subject: [PATCH] Add in Upgrade routine to clear out possibly problematic records in the civicrm_mapping_field table --- CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl index 9a78a205fe..3bf32eb8bd 100644 --- a/CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/5.34.alpha1.mysql.tpl @@ -4,3 +4,8 @@ SELECT @country_id := id from civicrm_country where name = 'Korea, Republic of' AND iso_code = 'KR'; INSERT IGNORE INTO `civicrm_state_province` (`id`, `country_id`, `abbreviation`, `name`) VALUES (NULL, @country_id, '50', 'Sejong'); + +-- Remove any references to custom fields from mapping field table that no longer exist +DELETE FROM civicrm_mapping_field +WHERE name NOT IN ( SELECT concat('custom_', id) FROM civicrm_custom_field) +AND name LIKE 'custom_%'; -- 2.25.1