diff options
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r-- | Zotlabs/Update/_1232.php | 47 | ||||
-rw-r--r-- | Zotlabs/Update/_1233.php | 38 | ||||
-rw-r--r-- | Zotlabs/Update/_1234.php | 26 |
3 files changed, 111 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1232.php b/Zotlabs/Update/_1232.php new file mode 100644 index 000000000..d1e3d75b5 --- /dev/null +++ b/Zotlabs/Update/_1232.php @@ -0,0 +1,47 @@ +<?php + +namespace Zotlabs\Update; + +class _1232 { + + function run() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + return UPDATE_SUCCESS; + } + else { + q("START TRANSACTION"); + + $r = q("ALTER TABLE channel + DROP channel_r_stream, + DROP channel_r_profile, + DROP channel_r_photos, + DROP channel_r_abook, + DROP channel_w_stream, + DROP channel_w_wall, + DROP channel_w_tagwall, + DROP channel_w_comment, + DROP channel_w_mail, + DROP channel_w_photos, + DROP channel_w_chat, + DROP channel_a_delegate, + DROP channel_r_storage, + DROP channel_w_storage, + DROP channel_r_pages, + DROP channel_w_pages, + DROP channel_a_republish, + DROP channel_w_like" + ); + } + + if($r) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1233.php b/Zotlabs/Update/_1233.php new file mode 100644 index 000000000..bd85aa379 --- /dev/null +++ b/Zotlabs/Update/_1233.php @@ -0,0 +1,38 @@ +<?php + +namespace Zotlabs\Update; + +class _1233 { + + function run() { + + q("START TRANSACTION"); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("DROP INDEX item_uid_mid"); + + $r2 = q("create index item_uid_mid on item (uid, mid)"); + $r3 = q("create index xchan_photo_m on xchan (xchan_photo_m)"); + + $r = ($r1 && $r2 && $r3); + } + else { + $r1 = q("ALTER TABLE item DROP INDEX uid_mid"); + + $r2 = q("ALTER TABLE item ADD INDEX uid_mid (uid, mid)"); + $r3 = q("ALTER TABLE xchan ADD INDEX xchan_photo_m (xchan_photo_m)"); + + $r = ($r1 && $r2 && $r3); + } + + if($r) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1234.php b/Zotlabs/Update/_1234.php new file mode 100644 index 000000000..b1b3b0c4e --- /dev/null +++ b/Zotlabs/Update/_1234.php @@ -0,0 +1,26 @@ +<?php + +namespace Zotlabs\Update; + +class _1234 { + + function run() { + + q("START TRANSACTION"); + + $r = q("DELETE FROM app WHERE app_name = '%s' OR app_name = '%s'", + dbesc('Events'), + dbesc('CalDAV') + ); + + if($r) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} |