aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php
index b923acf74..6f3e28791 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1148 );
+define( 'UPDATE_VERSION' , 1149 );
/**
*
@@ -1714,3 +1714,22 @@ function update_r1147() {
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;
+
+} \ No newline at end of file