Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316730

Change subject: Add timezone column to export
......................................................................

Add timezone column to export

Getting directly from civicrm_address table. Depends on crm change
I03f00c016ee15f to populate that field on save, at least for US
addresses with zip codes.

Bug: T148578
Change-Id: I13927a205222fcce8de10ec9741c7dc82299fee2
---
M silverpop_export/update_table.sql
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/30/316730/1

diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 9773cd4..befbcb4 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -40,6 +40,7 @@
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
+  timezone varchar(5),
 
   INDEX spex_contact_id (contact_id),
   INDEX spex_email (email),
@@ -222,7 +223,8 @@
     ex.city = addr.city,
     ex.country = ctry.iso_code,
     ex.postal_code = addr.postal_code,
-    ex.state = st.name
+    ex.state = st.name,
+    ex.timezone = addr.timezone
   WHERE
     ex.country IS NULL AND
     ex.opted_out = 0;
@@ -334,6 +336,7 @@
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
+  timezone varchar(5),
 
   INDEX rspex_contact_id (contact_id),
   INDEX rspex_email (email),
@@ -349,11 +352,11 @@
   id,contact_id,first_name,last_name,preferred_language,email,
   has_recurred_donation,highest_usd_amount,lifetime_usd_total,donation_count,
   latest_currency,latest_native_amount,latest_usd_amount,latest_donation,
-  city,country,state,postal_code )
+  city,country,state,postal_code,timezone )
 SELECT id,contact_id,first_name,last_name,preferred_language,email,
   has_recurred_donation,highest_usd_amount,lifetime_usd_total,donation_count,
   latest_currency,latest_native_amount,latest_usd_amount,latest_donation,
-  city,country,state,postal_code
+  city,country,state,postal_code,timezone
 FROM silverpop_export_staging
 WHERE opted_out=0;
 
@@ -367,6 +370,7 @@
     country,
     state,
     postal_code,
+    timezone,
     SUBSTRING(preferred_language, 1, 2) IsoLang,
     IF(has_recurred_donation, 'YES', 'NO') has_recurred_donation,
     highest_usd_amount,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13927a205222fcce8de10ec9741c7dc82299fee2
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to