diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-31 20:55:25 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-31 20:55:25 -0700 |
commit | d7cf7316beaecc6efacc01d56dbb066af8174416 (patch) | |
tree | 49a556c5055a0c75646e53ffb867da4aec08496e /install/update.php | |
parent | 96c61fc5f26af06bf43ecae0819c095141e18db7 (diff) | |
download | volse-hubzilla-d7cf7316beaecc6efacc01d56dbb066af8174416.tar.gz volse-hubzilla-d7cf7316beaecc6efacc01d56dbb066af8174416.tar.bz2 volse-hubzilla-d7cf7316beaecc6efacc01d56dbb066af8174416.zip |
change the likes db structure to make it more easily importable/exportable
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 21 |
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 |