jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/352943 )

Change subject: Add update_7522 to allow for search by phone number Bug: T97372
......................................................................


Add update_7522 to allow for search by phone number Bug: T97372

Change-Id: I5d692f841018c75e0f499b8977eb94e33487173b
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 18 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Ejegg: Looks good to me, approved



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 8b4cb25..9a94eec 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2979,3 +2979,21 @@
   wmf_civicrm_bootstrap_civi();
   wmf_civicrm_create_option_values( 'payment_instrument', $payment_instruments 
);
 }
+
+/**
+ * Normalize old phone numbers
+ **/
+function wmf_civicrm_update_7522() {
+  civicrm_initialize();
+  $maxId = CRM_CORE_DAO::singleValueQuery("SELECT max(id) FROM civicrm_phone");
+  $batch = 100000;
+  for($startId = 0; $startId < $maxId; $startId += $batch) {
+    $endId = $startId + $batch;
+    CRM_Core_DAO::executeQuery("
+      UPDATE civicrm_phone
+      SET phone_numeric = civicrm_strip_non_numeric(phone)
+      WHERE id BETWEEN $startId AND $endId
+    ");
+  }
+}
+

-- 
To view, visit https://gerrit.wikimedia.org/r/352943
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d692f841018c75e0f499b8977eb94e33487173b
Gerrit-PatchSet: 4
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Mepps <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to