Adds scripts to retrieve pre geocoded data from dev server.
authorStéphane Jacob <sj@m4x.org>
Fri, 13 May 2011 12:29:59 +0000 (14:29 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 13 May 2011 12:29:59 +0000 (14:29 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
upgrade/1.1.2/README [new file with mode: 0644]
upgrade/1.1.2/retrieve_address_tables.sh [new file with mode: 0755]
upgrade/1.1.2/xx_retrieve_geocoding.sql [new file with mode: 0644]

diff --git a/upgrade/1.1.2/README b/upgrade/1.1.2/README
new file mode 100644 (file)
index 0000000..272bed9
--- /dev/null
@@ -0,0 +1,2 @@
+Once all sql/php scripts have be run, run retrieve_address_tables.sh and finally xx_retrieve_geocoding.sql.
+Then "./formatAddresses.php -g -t g -r e" will format the last ungeocoded addresses.
diff --git a/upgrade/1.1.2/retrieve_address_tables.sh b/upgrade/1.1.2/retrieve_address_tables.sh
new file mode 100755 (executable)
index 0000000..94cdb9a
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+mysqldump -h murphy geocoding profile_addresses | sed -e 's/profile_addresses/tmp_profile_addresses/' | mysql x5dat
+mysqldump -h murphy geocoding profile_addresses_components | mysql x5dat
+mysqldump -h murphy geocoding profile_addresses_components_enum | mysql x5dat
+
diff --git a/upgrade/1.1.2/xx_retrieve_geocoding.sql b/upgrade/1.1.2/xx_retrieve_geocoding.sql
new file mode 100644 (file)
index 0000000..95da5cd
--- /dev/null
@@ -0,0 +1,11 @@
+    UPDATE  profile_addresses     AS pa
+INNER JOIN  tmp_profile_addresses AS ta ON (pa.pid = ta.pid AND pa.jobid = ta.jobid AND pa.groupid = ta.groupid AND pa.type = ta.type AND pa.text = ta.text)
+       SET  pa.id = ta.id, pa.postalText = ta.postalText, pa.formatted_address = ta.formatted_address, pa.types = ta.types,
+            pa.latitude = ta.latitude, pa.longitude = ta.longitude, pa.southwest_latitude = ta.southwest_latitude,
+            pa.southwest_longitude = ta.southwest_longitude, pa.northeast_latitude = ta.northeast_latitude, pa.northeast_longitude = ta.northeast_longitude,
+            pa.location_type = ta.location_type, pa.partial_match = ta.partial_match,
+            pa.geocoding_date = ta.geocoding_date, pa.geocoding_calls = ta.geocoding_calls;
+
+DROP TABLE tmp_profile_addresses;
+
+-- vim:set syntax=mysql: