aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-05-20 20:48:52 +0200
committerMario Vavti <mario@mariovavti.com>2018-05-20 20:48:52 +0200
commit55e1026c986f1c2c7e2a0376579b01111a93ab5d (patch)
tree07ef5c61899d410466ffcc682d491be7e943f0f1
parent9e1af2492ff30f65e678ca1b885350069583ade0 (diff)
downloadvolse-hubzilla-55e1026c986f1c2c7e2a0376579b01111a93ab5d.tar.gz
volse-hubzilla-55e1026c986f1c2c7e2a0376579b01111a93ab5d.tar.bz2
volse-hubzilla-55e1026c986f1c2c7e2a0376579b01111a93ab5d.zip
improve abconfig queries
-rw-r--r--Zotlabs/Update/_1213.php28
-rwxr-xr-xboot.php2
-rw-r--r--install/schema_mysql.sql3
3 files changed, 30 insertions, 3 deletions
diff --git a/Zotlabs/Update/_1213.php b/Zotlabs/Update/_1213.php
new file mode 100644
index 000000000..d396829a6
--- /dev/null
+++ b/Zotlabs/Update/_1213.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1213 {
+
+ function run() {
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ q("START TRANSACTION");
+
+ $r = q("ALTER TABLE abconfig
+ DROP INDEX chan,
+ DROP INDEX xchan,
+ ADD INDEX chan_xchan (chan, xchan)
+ ");
+
+ if($r) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+ else {
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+ }
+ }
+ }
+
+}
diff --git a/boot.php b/boot.php
index 36f50533b..b1043ef05 100755
--- a/boot.php
+++ b/boot.php
@@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.5.6' );
define ( 'ZOT_REVISION', '6.0a' );
-define ( 'DB_UPDATE_VERSION', 1212 );
+define ( 'DB_UPDATE_VERSION', 1213 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 1e91619e3..9bf91fc51 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -7,8 +7,7 @@ CREATE TABLE IF NOT EXISTS `abconfig` (
`k` char(191) NOT NULL DEFAULT '',
`v` mediumtext NOT NULL,
PRIMARY KEY (`id`),
- KEY `chan` (`chan`),
- KEY `xchan` (`xchan`),
+ KEY `chan_xchan` (`chan`, `xchan`),
KEY `cat` (`cat`),
KEY `k` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;