aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Update/_1203.php29
-rwxr-xr-xboot.php4
-rwxr-xr-xinclude/items.php2
-rw-r--r--install/schema_mysql.sql6
4 files changed, 35 insertions, 6 deletions
diff --git a/Zotlabs/Update/_1203.php b/Zotlabs/Update/_1203.php
new file mode 100644
index 000000000..2968d209d
--- /dev/null
+++ b/Zotlabs/Update/_1203.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1203 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r = q("ALTER TABLE item
+ DROP INDEX item_wall,
+ DROP INDEX item_starred,
+ DROP INDEX item_retained,
+ ADD INDEX uid_item_wall (uid, item_wall),
+ ADD INDEX uid_item_starred (uid, item_starred),
+ ADD INDEX uid_item_retained (uid, item_retained)
+ ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+ }
+ else {
+ return UPDATE_SUCCESS;
+ }
+
+ }
+
+}
diff --git a/boot.php b/boot.php
index 964e4341d..0cc3f10fd 100755
--- a/boot.php
+++ b/boot.php
@@ -50,10 +50,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
-define ( 'STD_VERSION', '3.1.10' );
+define ( 'STD_VERSION', '3.1.11' );
define ( 'ZOT_REVISION', '1.3' );
-define ( 'DB_UPDATE_VERSION', 1202 );
+define ( 'DB_UPDATE_VERSION', 1203 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/include/items.php b/include/items.php
index 04962ec76..68fa4c3b2 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3477,7 +3477,7 @@ function item_expire($uid,$days) {
AND item_thread_top = 1
AND resource_type = ''
AND item_starred = 0
- $sql_extra $item_normal ORDER BY created ASC LIMIT $expire_limit ",
+ $sql_extra $item_normal LIMIT $expire_limit ",
intval($uid),
db_utcnow(),
db_quoteinterval(intval($days).' DAY')
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 8d1c8d648..36cd2539b 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -654,6 +654,9 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `uid_item_type` (`uid`, `item_type`),
KEY `uid_item_thread_top` (`uid`, `item_thread_top`),
KEY `uid_item_blocked` (`uid`, `item_blocked`),
+ KEY `uid_item_wall` (`uid`, `item_wall`),
+ KEY `uid_item_starred` (`uid`, `item_starred`),
+ KEY `uid_item_retained` (`uid`, `item_retained`),
KEY `aid` (`aid`),
KEY `owner_xchan` (`owner_xchan`),
KEY `author_xchan` (`author_xchan`),
@@ -679,9 +682,7 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `changed` (`changed`),
KEY `item_origin` (`item_origin`),
KEY `item_unseen` (`item_unseen`),
- KEY `item_starred` (`item_starred`),
KEY `item_uplink` (`item_uplink`),
- KEY `item_wall` (`item_wall`),
KEY `item_notshown` (`item_notshown`),
KEY `item_nsfw` (`item_nsfw`),
KEY `item_relay` (`item_relay`),
@@ -689,7 +690,6 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `item_nocomment` (`item_nocomment`),
KEY `item_obscured` (`item_obscured`),
KEY `item_verified` (`item_verified`),
- KEY `item_retained` (`item_retained`),
KEY `item_rss` (`item_rss`),
KEY `item_consensus` (`item_consensus`),
KEY `item_deleted_pending_remove_changed` (`item_deleted`, `item_pending_remove`, `changed`)