this will fix the cards query and keep the rest intact

This commit is contained in:
Mario Vavti 2018-02-04 22:37:30 +01:00
parent f9aecf5d4c
commit 9d55a254dc
5 changed files with 19 additions and 7 deletions

View File

@ -143,7 +143,7 @@ class Cards extends \Zotlabs\Web\Controller {
} }
$r = q("select * from item $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", $sql_extra order by item.created desc",
intval($owner), intval($owner),
intval(ITEM_TYPE_CARD) intval(ITEM_TYPE_CARD)

View File

@ -65,7 +65,7 @@ class Forums {
for($x = 0; $x < count($r1); $x ++) { for($x = 0; $x < count($r1); $x ++) {
$r = q("select sum(item_unseen) as unseen from item $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']), dbesc($r1[$x]['xchan_hash']),
intval(local_channel()) intval(local_channel())
); );

View File

@ -51,10 +51,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php'); require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '3.1.6' ); define ( 'STD_VERSION', '3.1.7' );
define ( 'ZOT_REVISION', '1.3' ); define ( 'ZOT_REVISION', '1.3' );
define ( 'DB_UPDATE_VERSION', 1199 ); define ( 'DB_UPDATE_VERSION', 1200 );
define ( 'PROJECT_BASE', __DIR__ ); define ( 'PROJECT_BASE', __DIR__ );

View File

@ -644,7 +644,6 @@ CREATE TABLE IF NOT EXISTS `item` (
`item_pending_remove` tinyint(1) NOT NULL DEFAULT 0 , `item_pending_remove` tinyint(1) NOT NULL DEFAULT 0 ,
`item_blocked` tinyint(1) NOT NULL DEFAULT 0 , `item_blocked` tinyint(1) NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `parent` (`parent`), KEY `parent` (`parent`),
KEY `created` (`created`), KEY `created` (`created`),
KEY `edited` (`edited`), KEY `edited` (`edited`),
@ -690,7 +689,8 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `item_verified` (`item_verified`), KEY `item_verified` (`item_verified`),
KEY `item_retained` (`item_retained`), KEY `item_retained` (`item_retained`),
KEY `item_rss` (`item_rss`), 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; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `item_id` ( CREATE TABLE IF NOT EXISTS `item_id` (

View File

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1199 ); define( 'UPDATE_VERSION' , 1200 );
/** /**
* *
@ -3087,3 +3087,15 @@ function update_r1198() {
return UPDATE_SUCCESS; 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;
}