Corrected field names

This commit is contained in:
Michael 2018-01-12 23:20:19 +00:00
parent 9e37b49bea
commit fc9453b7e9
3 changed files with 18 additions and 7 deletions

View File

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 3.6-dev (Asparagus) -- Friendica 3.6-dev (Asparagus)
-- DB_UPDATE_VERSION 1239 -- DB_UPDATE_VERSION 1241
-- ------------------------------------------ -- ------------------------------------------
@ -650,9 +650,10 @@ CREATE TABLE IF NOT EXISTS `notify-threads` (
-- --
CREATE TABLE IF NOT EXISTS `oembed` ( CREATE TABLE IF NOT EXISTS `oembed` (
`url` varbinary(255) NOT NULL, `url` varbinary(255) NOT NULL,
`maxwidth` int(11) NOT NULL,
`content` mediumtext, `content` mediumtext,
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY(`url`), PRIMARY KEY(`url`,`maxwidth`),
INDEX `created` (`created`) INDEX `created` (`created`)
) DEFAULT COLLATE utf8mb4_general_ci; ) DEFAULT COLLATE utf8mb4_general_ci;
@ -669,6 +670,16 @@ CREATE TABLE IF NOT EXISTS `parsed_url` (
INDEX `created` (`created`) INDEX `created` (`created`)
) DEFAULT COLLATE utf8mb4_general_ci; ) DEFAULT COLLATE utf8mb4_general_ci;
--
-- TABLE participation
--
CREATE TABLE IF NOT EXISTS `participation` (
`iid` int(10) unsigned NOT NULL,
`server` varchar(60) NOT NULL,
`cid` int(10) unsigned NOT NULL,
PRIMARY KEY(`iid`,`server`)
) DEFAULT COLLATE utf8mb4_general_ci;
-- --
-- TABLE pconfig -- TABLE pconfig
-- --

View File

@ -1301,12 +1301,12 @@ class DBStructure {
); );
$database["participation"] = array( $database["participation"] = array(
"fields" => array( "fields" => array(
"item" => array("type" => "int(10) unsigned", "not null" => "1", "primary" => "1", "relation" => array("item" => "id")), "iid" => array("type" => "int(10) unsigned", "not null" => "1", "primary" => "1", "relation" => array("item" => "id")),
"contact" => array("type" => "int(10) unsigned", "not null" => "1", "relation" => array("contact" => "id")),
"server" => array("type" => "varchar(60)", "not null" => "1", "primary" => "1"), "server" => array("type" => "varchar(60)", "not null" => "1", "primary" => "1"),
"cid" => array("type" => "int(10) unsigned", "not null" => "1", "relation" => array("contact" => "id")),
), ),
"indexes" => array( "indexes" => array(
"PRIMARY" => array("item", "server") "PRIMARY" => array("iid", "server")
) )
); );
$database["pconfig"] = array( $database["pconfig"] = array(

View File

@ -115,9 +115,9 @@ class Diaspora
{ {
$r = dba::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`, $r = dba::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`,
`fcontact`.`batch` AS `fbatch`, `fcontact`.`network` AS `fnetwork` FROM `participation` `fcontact`.`batch` AS `fbatch`, `fcontact`.`network` AS `fnetwork` FROM `participation`
INNER JOIN `contact` ON `contact`.`id` = `participation`.`contact` INNER JOIN `contact` ON `contact`.`id` = `participation`.`cid`
LEFT JOIN `fcontact` ON `fcontact`.`url` = `contact`.`url` LEFT JOIN `fcontact` ON `fcontact`.`url` = `contact`.`url`
WHERE `participation`.`item` = ?", $thread); WHERE `participation`.`iid` = ?", $thread);
while ($contact = dba::fetch($r)) { while ($contact = dba::fetch($r)) {
if (!empty($contact['fnetwork'])) { if (!empty($contact['fnetwork'])) {