aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-05-08 23:30:48 +0200
committerMax Kostikov <max@kostikov.co>2019-05-08 23:30:48 +0200
commit44d5cf980a7196a49be2ff9f3742ba55929fd2d0 (patch)
treeb96ddcbf095608d2a6f11f139cf00ac268ef344c /Zotlabs/Update
parent5bf9a9828c4000c8f293efc17bc094c026a5dc0a (diff)
parente53650d6c66a9338259dc7cd7f067b8e80d6ce19 (diff)
downloadvolse-hubzilla-44d5cf980a7196a49be2ff9f3742ba55929fd2d0.tar.gz
volse-hubzilla-44d5cf980a7196a49be2ff9f3742ba55929fd2d0.tar.bz2
volse-hubzilla-44d5cf980a7196a49be2ff9f3742ba55929fd2d0.zip
Merge branch 'dev' into 'dev'
another DB update to fix uid_mid index in item table and add xchan_photo_m index to xchan table See merge request hubzilla/core!1641
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r--Zotlabs/Update/_1233.php38
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;
+
+ }
+
+}