[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Add timezone column to export

2016-11-01 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

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/tests/minimal_schema.sql
M silverpop_export/update_table.sql
2 files changed, 9 insertions(+), 4 deletions(-)

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



diff --git a/silverpop_export/tests/minimal_schema.sql 
b/silverpop_export/tests/minimal_schema.sql
index 966a64c..4f8682a 100644
--- a/silverpop_export/tests/minimal_schema.sql
+++ b/silverpop_export/tests/minimal_schema.sql
@@ -75,7 +75,8 @@
 city varchar(64) COLLATE utf8_unicode_ci,
 postal_code varchar(64) COLLATE utf8_unicode_ci,
 country_id int(10) unsigned,
-state_province_id int(10) unsigned
+state_province_id int(10) unsigned,
+timezone varchar(8) COLLATE utf8_unicode_ci
 );
 
 drop table if exists civicrm_country;
diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index a306bdc..1cb1c28 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),
@@ -225,7 +226,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;
@@ -338,6 +340,7 @@
   country varchar(2),
   state varchar(64),
   postal_code varchar(128),
+  timezone varchar(5),
 
   INDEX rspex_contact_id (contact_id),
   INDEX rspex_email (email),
@@ -353,11 +356,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;
 
@@ -371,6 +374,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: merged
Gerrit-Change-Id: I13927a205222fcce8de10ec9741c7dc82299fee2
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Add timezone column to export

2016-10-18 Thread Ejegg (Code Review)
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 

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