aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-31 21:00:28 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-08-31 21:00:28 -0700
commitd7089ab471d446453f41ba1311b3d7186d86ff4c (patch)
treece75108ac809d77d33217e8e844ec0a8b0e3965b /install/update.php
parent039f56f390c69ad0aedadcca3d611fea0d9eebf9 (diff)
parentd7cae1ce2abfda2049bcb9510ae1916865bb55a3 (diff)
downloadvolse-hubzilla-d7089ab471d446453f41ba1311b3d7186d86ff4c.tar.gz
volse-hubzilla-d7089ab471d446453f41ba1311b3d7186d86ff4c.tar.bz2
volse-hubzilla-d7089ab471d446453f41ba1311b3d7186d86ff4c.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts: include/identity.php install/update.php util/messages.po view/nl/messages.po
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php
index 9aca14d2e..b398711b2 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1148 );
+define( 'UPDATE_VERSION' , 1149 );
/**
*
@@ -1728,3 +1728,23 @@ function update_r1147() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1148() {
+ $r1 = q("alter table likes add i_mid char(255) not null default '' ");
+ $r2 = q("create index i_mid on likes ( i_mid ) ");
+
+ $r3 = q("select likes.*, item.mid from from likes left join item on likes.iid = item.id");
+ if($r3) {
+ foreach($r3 as $rr) {
+ q("update likes set i_mid = '%s' where id = $d",
+ dbesc($rr['mid']),
+ intval($rr['id'])
+ );
+ }
+ }
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}