aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-07-31 16:49:56 +0200
committerMario Vavti <mario@mariovavti.com>2017-07-31 17:30:06 +0200
commitd33974cec44d7ed7a648a4e30380c3dfa3f11b2f (patch)
tree22434a73a44194dd8792e1d9a35c66f58f4a615f
parenta3fef34a3f542905247031d0dfd7ec661fbefd1c (diff)
downloadvolse-hubzilla-d33974cec44d7ed7a648a4e30380c3dfa3f11b2f.tar.gz
volse-hubzilla-d33974cec44d7ed7a648a4e30380c3dfa3f11b2f.tar.bz2
volse-hubzilla-d33974cec44d7ed7a648a4e30380c3dfa3f11b2f.zip
db update to add index for item.obj_type
-rwxr-xr-xboot.php2
-rw-r--r--install/schema_mysql.sql1
-rw-r--r--install/schema_postgres.sql1
-rw-r--r--install/update.php14
4 files changed, 16 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index e83436039..b42a64480 100755
--- a/boot.php
+++ b/boot.php
@@ -52,7 +52,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '2.6RC' );
define ( 'ZOT_REVISION', '1.2' );
-define ( 'DB_UPDATE_VERSION', 1192 );
+define ( 'DB_UPDATE_VERSION', 1193 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 4430e9f10..9e2e401b5 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -660,6 +660,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `item_flags` (`item_flags`),
KEY `commented` (`commented`),
KEY `verb` (`verb`),
+ KEY `obj_type` (`obj_type`),
KEY `item_private` (`item_private`),
KEY `llink` (`llink`),
KEY `expires` (`expires`),
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index f3cead9b7..0bc783692 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -631,6 +631,7 @@ create index "item_restrict" on item ("item_restrict");
create index "item_flags" on item ("item_flags");
create index "item_commented" on item ("commented");
create index "item_verb" on item ("verb");
+create index "item_obj_type" on item ("obj_type");
create index "item_private" on item ("item_private");
create index "item_llink" on item ("llink");
create index "item_expires" on item ("expires");
diff --git a/install/update.php b/install/update.php
index ac560f4db..8798a3d69 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1192 );
+define( 'UPDATE_VERSION' , 1193 );
/**
*
@@ -2963,6 +2963,18 @@ function update_r1191() {
return UPDATE_FAILED;
}
}
+}
+function update_r1192() {
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("CREATE INDEX item_obj_type ON item (obj_type)");
+ }
+ else {
+ $r1 = q("ALTER TABLE item ADD INDEX (obj_type)");
+ }
+
+ if($r1)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
}