New fields "author-id" and "owner-id" in the item table

This commit is contained in:
Michael Vogel 2016-06-15 21:20:55 +02:00
parent 5ec7626b12
commit 0e35427dfc
5 changed files with 13 additions and 3 deletions

View file

@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_CODENAME', 'Asparagus');
define ( 'FRIENDICA_VERSION', '3.5-dev' ); define ( 'FRIENDICA_VERSION', '3.5-dev' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1196 ); define ( 'DB_UPDATE_VERSION', 1197 );
/** /**
* @brief Constant with a HTML line break. * @brief Constant with a HTML line break.

View file

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 3.5-dev (Asparagus) -- Friendica 3.5-dev (Asparagus)
-- DB_UPDATE_VERSION 1196 -- DB_UPDATE_VERSION 1197
-- ------------------------------------------ -- ------------------------------------------
@ -458,9 +458,11 @@ CREATE TABLE IF NOT EXISTS `item` (
`commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`owner-id` int(11) NOT NULL DEFAULT 0,
`owner-name` varchar(255) NOT NULL DEFAULT '', `owner-name` varchar(255) NOT NULL DEFAULT '',
`owner-link` varchar(255) NOT NULL DEFAULT '', `owner-link` varchar(255) NOT NULL DEFAULT '',
`owner-avatar` varchar(255) NOT NULL DEFAULT '', `owner-avatar` varchar(255) NOT NULL DEFAULT '',
`author-id` int(11) NOT NULL DEFAULT 0,
`author-name` varchar(255) NOT NULL DEFAULT '', `author-name` varchar(255) NOT NULL DEFAULT '',
`author-link` varchar(255) NOT NULL DEFAULT '', `author-link` varchar(255) NOT NULL DEFAULT '',
`author-avatar` varchar(255) NOT NULL DEFAULT '', `author-avatar` varchar(255) NOT NULL DEFAULT '',

View file

@ -792,9 +792,11 @@ function db_definition() {
"commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"),
"owner-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
"author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),

View file

@ -584,6 +584,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
"photo" => $arr['author-avatar'], "name" => $arr['author-name'])); "photo" => $arr['author-avatar'], "name" => $arr['author-name']));
} }
if ($arr["author-id"] == 0)
$arr["author-id"] = get_contact($arr["author-link"], 0);
if ($arr["owner-id"] == 0)
$arr["owner-id"] = get_contact($arr["owner-link"], 0);
if ($arr['guid'] != "") { if ($arr['guid'] != "") {
// Checking if there is already an item with the same guid // Checking if there is already an item with the same guid
logger('checking for an item for user '.$arr['uid'].' on network '.$arr['network'].' with the guid '.$arr['guid'], LOGGER_DEBUG); logger('checking for an item for user '.$arr['uid'].' on network '.$arr['network'].' with the guid '.$arr['guid'], LOGGER_DEBUG);

View file

@ -1,6 +1,6 @@
<?php <?php
define('UPDATE_VERSION' , 1196); define('UPDATE_VERSION' , 1197);
/** /**
* *