diff options
author | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
---|---|---|
committer | Manuel Jiménez Friaza <mjfriaza@openmailbox.org> | 2019-05-19 13:25:00 +0200 |
commit | 429140df97a2c273fba6974147ac2e48e7688263 (patch) | |
tree | 2e337542da1b0f4c9c383dfeb8a7d9eb63990a72 /Zotlabs/Update/_1233.php | |
parent | f92d2e3f7c6573bd7bab04223c7e28662605c6d8 (diff) | |
parent | af2b263bc74b16601ec7c123a58f0549613aed27 (diff) | |
download | volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.gz volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.tar.bz2 volse-hubzilla-429140df97a2c273fba6974147ac2e48e7688263.zip |
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Update/_1233.php')
-rw-r--r-- | Zotlabs/Update/_1233.php | 38 |
1 files changed, 38 insertions, 0 deletions
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; + + } + +} |