X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=database.sql;h=e9db927f1ef4bcbd20c75d3f114772bec6b5ae5b;hb=3a0c18713e5c83824a410547c6c7fd804220f1d1;hp=5b6f1695c389c0c3bdc3cd933349e87ba9bcb5ea;hpb=2f7789e397d55755e46d574a0cd5a6a2bf83cf5a;p=friendica.git diff --git a/database.sql b/database.sql index 5b6f1695c3..e9db927f1e 100644 --- a/database.sql +++ b/database.sql @@ -1695,7 +1695,7 @@ CREATE TABLE IF NOT EXISTS `report` ( `uid` mediumint unsigned COMMENT 'Reporting user', `reporter-id` int unsigned COMMENT 'Reporting contact', `cid` int unsigned NOT NULL COMMENT 'Reported contact', - `gsid` int unsigned NOT NULL COMMENT 'Reported contact server', + `gsid` int unsigned COMMENT 'Reported contact server', `comment` text COMMENT 'Report', `category-id` int unsigned NOT NULL DEFAULT 1 COMMENT 'Report category, one of Entity\Report::CATEGORY_*', `forward` boolean COMMENT 'Forward the report to the remote server', @@ -1712,6 +1712,7 @@ CREATE TABLE IF NOT EXISTS `report` ( INDEX `cid` (`cid`), INDEX `reporter-id` (`reporter-id`), INDEX `gsid` (`gsid`), + INDEX `last-editor-uid` (`last-editor-uid`), INDEX `assigned-uid` (`assigned-uid`), INDEX `status-resolution` (`status`,`resolution`), INDEX `created` (`created`), @@ -2635,13 +2636,15 @@ CREATE VIEW `network-item-view` AS SELECT `ownercontact`.`contact-type` AS `contact-type` FROM `post-user` INNER JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` - INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id` + STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id` + STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id` + STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id` LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id` LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id` - INNER JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id` WHERE `post-user`.`visible` AND NOT `post-user`.`deleted` AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`) AND (`post-user`.`hidden` IS NULL OR NOT `post-user`.`hidden`) + AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked` AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`) AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`); @@ -2664,12 +2667,14 @@ CREATE VIEW `network-thread-view` AS SELECT FROM `post-thread-user` INNER JOIN `post-user` ON `post-user`.`id` = `post-thread-user`.`post-user-id` STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id` + STRAIGHT_JOIN `contact` AS `authorcontact` ON `authorcontact`.`id` = `post-thread-user`.`author-id` + STRAIGHT_JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id` LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id` LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id` - LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `post-thread-user`.`owner-id` WHERE `post-user`.`visible` AND NOT `post-user`.`deleted` AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`) AND (`post-thread-user`.`hidden` IS NULL OR NOT `post-thread-user`.`hidden`) + AND NOT `authorcontact`.`blocked` AND NOT `ownercontact`.`blocked` AND (`author`.`blocked` IS NULL OR NOT `author`.`blocked`) AND (`owner`.`blocked` IS NULL OR NOT `owner`.`blocked`);