aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-15 18:52:04 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-15 18:52:04 -0700
commit93f061f78a8b914a731838058a38354a62d002de (patch)
treea2444956ccadaad1ef5dcda1a98364bbc987d3a9 /install/update.php
parent7517c76ae48ddad741fe61c41dd6dcc09421d160 (diff)
downloadvolse-hubzilla-93f061f78a8b914a731838058a38354a62d002de.tar.gz
volse-hubzilla-93f061f78a8b914a731838058a38354a62d002de.tar.bz2
volse-hubzilla-93f061f78a8b914a731838058a38354a62d002de.zip
mail sync/migrate continued; also abstract delivery loop to make it re-usable, change refresh_all to use delivery loop.
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php
index e120f91d2..dc9377892 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1887,6 +1887,23 @@ function update_r1155() {
function update_r1156() {
- return UPDATE_SUCCESS;
+ $r1 = q("ALTER TABLE mail ADD conv_guid CHAR( 255 ) NOT NULL DEFAULT '' ");
+ $r2 = q("create index conv_guid on mail ( conv_guid ) ");
+
+ $r3 = q("select mail.id, mail.convid, conv.guid from mail left join conv on mail.convid = conv.id where true");
+ if($r3) {
+ foreach($r3 as $rr) {
+ if($rr['convid']) {
+ q("update mail set conv_guid = '%s' where id = %d",
+ dbesc($rr['guid']),
+ intval($rr['id'])
+ );
+ }
+ }
+ }
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
}