]> git.mxchange.org Git - friendica.git/commitdiff
Corrected field names
authorMichael <heluecht@pirati.ca>
Fri, 12 Jan 2018 23:20:19 +0000 (23:20 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 12 Jan 2018 23:20:19 +0000 (23:20 +0000)
database.sql
src/Database/DBStructure.php
src/Protocol/Diaspora.php

index 48c2e7ecee354d1a6f561e99314cbb585cf20efe..79e81f1d2294a013d75252207c58bc8bd43b1561 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- 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` (
        `url` varbinary(255) NOT NULL,
+       `maxwidth` int(11) NOT NULL,
        `content` mediumtext,
        `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
-        PRIMARY KEY(`url`),
+        PRIMARY KEY(`url`,`maxwidth`),
         INDEX `created` (`created`)
 ) DEFAULT COLLATE utf8mb4_general_ci;
 
@@ -669,6 +670,16 @@ CREATE TABLE IF NOT EXISTS `parsed_url` (
         INDEX `created` (`created`)
 ) 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
 --
index 6ceeb573fed80b149eb357317277b37af45f59cc..2d9b4fc13ba70acf3e371541fa52a831d66ffb32 100644 (file)
@@ -1301,12 +1301,12 @@ class DBStructure {
                                );
                $database["participation"] = array(
                                "fields" => array(
-                                               "item" => 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")),
+                                               "iid" => array("type" => "int(10) unsigned", "not null" => "1", "primary" => "1", "relation" => array("item" => "id")),
                                                "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(
-                                               "PRIMARY" => array("item", "server")
+                                               "PRIMARY" => array("iid", "server")
                                                )
                                );
                $database["pconfig"] = array(
index 747a1b2e1f281f35289550f50d8894da943e8dec..b2a4389058e28ca339b662c4815478406932005f 100644 (file)
@@ -115,9 +115,9 @@ class Diaspora
        {
                $r = dba::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`,
                                `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`
-                               WHERE `participation`.`item` = ?", $thread);
+                               WHERE `participation`.`iid` = ?", $thread);
 
                while ($contact = dba::fetch($r)) {
                        if (!empty($contact['fnetwork'])) {