aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Cards.php2
-rw-r--r--Zotlabs/Widget/Forums.php2
-rwxr-xr-xboot.php4
-rw-r--r--install/schema_mysql.sql4
-rw-r--r--install/update.php14
5 files changed, 19 insertions, 7 deletions
diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php
index 8eff6c80d..f87988183 100644
--- a/Zotlabs/Module/Cards.php
+++ b/Zotlabs/Module/Cards.php
@@ -143,7 +143,7 @@ class Cards extends \Zotlabs\Web\Controller {
}
$r = q("select * from item
- where item.uid = %d and item_type = %d
+ where uid = %d and item_type = %d
$sql_extra order by item.created desc",
intval($owner),
intval(ITEM_TYPE_CARD)
diff --git a/Zotlabs/Widget/Forums.php b/Zotlabs/Widget/Forums.php
index b572444e3..f65a639ff 100644
--- a/Zotlabs/Widget/Forums.php
+++ b/Zotlabs/Widget/Forums.php
@@ -65,7 +65,7 @@ class Forums {
for($x = 0; $x < count($r1); $x ++) {
$r = q("select sum(item_unseen) as unseen from item
- where owner_xchan = '%s' and uid = %d and item_unseen = 1 $perms_sql ",
+ where uid = %d and owner_xchan = '%s' and item_unseen = 1 $perms_sql ",
dbesc($r1[$x]['xchan_hash']),
intval(local_channel())
);
diff --git a/boot.php b/boot.php
index 8eb6406b3..dd36006ee 100755
--- a/boot.php
+++ b/boot.php
@@ -51,10 +51,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
-define ( 'STD_VERSION', '3.1.6' );
+define ( 'STD_VERSION', '3.1.7' );
define ( 'ZOT_REVISION', '1.3' );
-define ( 'DB_UPDATE_VERSION', 1199 );
+define ( 'DB_UPDATE_VERSION', 1200 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index c011cc157..ea13e0de6 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -644,7 +644,6 @@ CREATE TABLE IF NOT EXISTS `item` (
`item_pending_remove` tinyint(1) NOT NULL DEFAULT 0 ,
`item_blocked` tinyint(1) NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`),
- KEY `uid` (`uid`),
KEY `parent` (`parent`),
KEY `created` (`created`),
KEY `edited` (`edited`),
@@ -690,7 +689,8 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `item_verified` (`item_verified`),
KEY `item_retained` (`item_retained`),
KEY `item_rss` (`item_rss`),
- KEY `item_consensus` (`item_consensus`)
+ KEY `item_consensus` (`item_consensus`),
+ KEY `item_type` (`item_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `item_id` (
diff --git a/install/update.php b/install/update.php
index 1bb39fc65..ceaccdfa3 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1199 );
+define( 'UPDATE_VERSION' , 1200 );
/**
*
@@ -3087,3 +3087,15 @@ function update_r1198() {
return UPDATE_SUCCESS;
}
+
+function update_r1199() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r = q("ALTER TABLE item
+ DROP INDEX uid,
+ ADD INDEX (item_type)
+ ");
+ }
+
+ return UPDATE_SUCCESS;
+}