diff options
Diffstat (limited to 'install/update.php')
-rw-r--r-- | install/update.php | 60 |
1 files changed, 55 insertions, 5 deletions
diff --git a/install/update.php b/install/update.php index 82792a82d..339d0cb25 100644 --- a/install/update.php +++ b/install/update.php @@ -1669,7 +1669,22 @@ function update_r1143() { } function update_r1144() { - // hubzilla update does not apply here, but we're keeping the numbers in sync + $r = q("select flags, id from attach where flags != 0"); + if($r) { + foreach($r as $rr) { + if($rr['flags'] & 1) { + q("update attach set is_dir = 1 where id = %d", + intval($rr['id']) + ); + } + if($rr['flags'] & 2) { + q("update attach set os_storage = 1 where id = %d", + intval($rr['id']) + ); + } + } + } + return UPDATE_SUCCESS; } @@ -1725,16 +1740,51 @@ function update_r1148() { } function update_r1149() { + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE obj ADD obj_term CHAR( 255 ) NOT NULL DEFAULT '', + ADD obj_url CHAR( 255 ) NOT NULL DEFAULT '', + ADD obj_imgurl CHAR( 255 ) NOT NULL DEFAULT '', + ADD obj_created timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', + ADD obj_edited timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' "); + } + else { + $r1 = q("ALTER TABLE obj ADD obj_term CHAR( 255 ) NOT NULL DEFAULT '', + ADD obj_url CHAR( 255 ) NOT NULL DEFAULT '', + ADD obj_imgurl CHAR( 255 ) NOT NULL DEFAULT '', + ADD obj_created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + ADD obj_edited DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' "); + } - // hubzilla update does not apply here, but we're keeping the numbers in sync - return UPDATE_SUCCESS; + $r2 = q("create index obj_term on obj ( obj_term ) "); + $r3 = q("create index obj_url on obj ( obj_url ) "); + $r4 = q("create index obj_imgurl on obj ( obj_imgurl ) "); + $r5 = q("create index obj_created on obj ( obj_created ) "); + $r6 = q("create index obj_edited on obj ( obj_edited ) "); + $r = $r1 && $r2 && $r3 && $r4 && $r5 && $r6; + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; } function update_r1150() { - // hubzilla update does not apply here, but we're keeping the numbers in sync - return UPDATE_SUCCESS; + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE app ADD app_created timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', + ADD app_edited timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' "); + } + else { + $r1 = q("ALTER TABLE app ADD app_created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + ADD app_edited DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' "); + } + + $r2 = q("create index app_created on app ( app_created ) "); + $r3 = q("create index app_edited on app ( app_edited ) "); + + $r = $r1 && $r2 && $r3; + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; } |