Merge pull request #9873 from annando/post-user
New "post-user" structure, new update functionality
This commit is contained in:
commit
9a4128a5c8
10 changed files with 258 additions and 72 deletions
|
@ -55,7 +55,7 @@
|
|||
use Friendica\Database\DBA;
|
||||
|
||||
if (!defined('DB_UPDATE_VERSION')) {
|
||||
define('DB_UPDATE_VERSION', 1394);
|
||||
define('DB_UPDATE_VERSION', 1395);
|
||||
}
|
||||
|
||||
return [
|
||||
|
@ -1218,8 +1218,9 @@ return [
|
|||
"post-user" => [
|
||||
"comment" => "User specific post data",
|
||||
"fields" => [
|
||||
"uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
|
||||
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
|
||||
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
|
||||
"uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
|
||||
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
|
||||
"protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
|
||||
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
|
||||
"unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
|
||||
|
@ -1229,7 +1230,8 @@ return [
|
|||
"psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
|
||||
],
|
||||
"indexes" => [
|
||||
"PRIMARY" => ["uid", "uri-id"],
|
||||
"PRIMARY" => ["id"],
|
||||
"uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
|
||||
"uri-id" => ["uri-id"],
|
||||
"contact-id" => ["contact-id"],
|
||||
"psid" => ["psid"],
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"fields" => [
|
||||
"id" => ["item", "id"],
|
||||
"item_id" => ["item", "id"],
|
||||
"post-user-id" => ["post-user", "id"],
|
||||
"uid" => ["item", "uid"],
|
||||
"parent" => ["item", "parent"],
|
||||
"uri" => ["item", "uri"],
|
||||
|
@ -175,6 +176,7 @@
|
|||
"parent-author-network" => ["parent-item-author", "network"],
|
||||
],
|
||||
"query" => "FROM `item`
|
||||
LEFT JOIN `post-user` ON `post-user`.`uri-id` = `item`.`uri-id` AND `post-user`.`uid` = `item`.`uid`
|
||||
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
STRAIGHT_JOIN `contact` AS `author` ON `author`.`id` = `item`.`author-id`
|
||||
STRAIGHT_JOIN `contact` AS `owner` ON `owner`.`id` = `item`.`owner-id`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue