]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Revert "Use last entry for Content-Type"
[friendica.git] / database.sql
index f598ab9ccb5363b9b5f5a7f0412766d41f7c25cd..1e439213d4b46c27b6dfdd63954e22a8dc20239e 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2020.12-dev (Red Hot Poker)
--- DB_UPDATE_VERSION 1369
+-- DB_UPDATE_VERSION 1370
 -- ------------------------------------------
 
 
@@ -1449,13 +1449,15 @@ CREATE VIEW `network-item-view` AS SELECT
        `item`.`network` AS `network`,
        `item`.`unseen` AS `unseen`,
        `item`.`gravity` AS `gravity`,
-       `item`.`contact-id` AS `contact-id`
+       `item`.`contact-id` AS `contact-id`,
+       `ownercontact`.`contact-type` AS `contact-type`
        FROM `item`
                        INNER JOIN `thread` ON `thread`.`iid` = `item`.`parent`
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
                        LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid`
                        LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id`
                        LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id`
+                       LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `thread`.`owner-id`
                        WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
                        AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
                        AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
@@ -1478,13 +1480,15 @@ CREATE VIEW `network-thread-view` AS SELECT
        `thread`.`starred` AS `starred`,
        `thread`.`mention` AS `mention`,
        `thread`.`network` AS `network`,
-       `thread`.`contact-id` AS `contact-id`
+       `thread`.`contact-id` AS `contact-id`,
+       `ownercontact`.`contact-type` AS `contact-type`
        FROM `thread`
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
                        STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid`
                        LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = `thread`.`uid`
                        LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `thread`.`uid` AND `author`.`cid` = `thread`.`author-id`
                        LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `thread`.`uid` AND `owner`.`cid` = `thread`.`owner-id`
+                       LEFT JOIN `contact` AS `ownercontact` ON `ownercontact`.`id` = `thread`.`owner-id`
                        WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated`
                        AND (NOT `contact`.`readonly` AND NOT `contact`.`blocked` AND NOT `contact`.`pending`)
                        AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)