]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Merge pull request #10159 from annando/fix-category
[friendica.git] / database.sql
index 5522b574bbf4cfa833a9e1c5ee74b0202ca1f536..1727911c93af61262e2ccf050691e406d72f4cb3 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2021.03-rc (Red Hot Poker)
--- DB_UPDATE_VERSION 1410
+-- DB_UPDATE_VERSION 1413
 -- ------------------------------------------
 
 
@@ -197,6 +197,9 @@ CREATE TABLE IF NOT EXISTS `contact` (
         INDEX `uid_network_self_lastupdate` (`uid`,`network`,`self`,`last-update`),
         INDEX `uid_lastitem` (`uid`,`last-item`),
         INDEX `baseurl` (`baseurl`(64)),
+        INDEX `uid_contact-type` (`uid`,`contact-type`),
+        INDEX `uid_self_contact-type` (`uid`,`self`,`contact-type`),
+        INDEX `self_network_uid` (`self`,`network`,`uid`),
         INDEX `gsid` (`gsid`),
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
@@ -931,7 +934,7 @@ CREATE TABLE IF NOT EXISTS `post` (
        `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the owner of this item',
        `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item',
        `causer-id` int unsigned COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation',
-       `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)',
+       `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, image, article, ...)',
        `vid` smallint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs',
        `private` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '0=public, 1=private, 2=unlisted',
        `global` boolean NOT NULL DEFAULT '0' COMMENT '',
@@ -1097,7 +1100,8 @@ CREATE TABLE IF NOT EXISTS `post-user` (
        `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the owner of this item',
        `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item',
        `causer-id` int unsigned COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation',
-       `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)',
+       `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, image, article, ...)',
+       `post-reason` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Reason why the post arrived at the user',
        `vid` smallint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs',
        `private` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '0=public, 1=private, 2=unlisted',
        `global` boolean NOT NULL DEFAULT '0' COMMENT '',
@@ -1485,10 +1489,12 @@ CREATE VIEW `post-user-view` AS SELECT
        `post-user`.`received` AS `received`,
        `post-thread-user`.`changed` AS `changed`,
        `post-user`.`post-type` AS `post-type`,
+       `post-user`.`post-reason` AS `post-reason`,
        `post-user`.`private` AS `private`,
        `post-thread-user`.`pubmail` AS `pubmail`,
        `post-user`.`visible` AS `visible`,
        `post-thread-user`.`starred` AS `starred`,
+       `post-thread-user`.`pinned` AS `pinned`,
        `post-user`.`unseen` AS `unseen`,
        `post-user`.`deleted` AS `deleted`,
        `post-user`.`origin` AS `origin`,
@@ -1643,11 +1649,13 @@ CREATE VIEW `post-thread-user-view` AS SELECT
        `post-thread-user`.`received` AS `received`,
        `post-thread-user`.`changed` AS `changed`,
        `post-user`.`post-type` AS `post-type`,
+       `post-user`.`post-reason` AS `post-reason`,
        `post-user`.`private` AS `private`,
        `post-thread-user`.`pubmail` AS `pubmail`,
        `post-thread-user`.`ignored` AS `ignored`,
        `post-user`.`visible` AS `visible`,
        `post-thread-user`.`starred` AS `starred`,
+       `post-thread-user`.`pinned` AS `pinned`,
        `post-thread-user`.`unseen` AS `unseen`,
        `post-user`.`deleted` AS `deleted`,
        `post-thread-user`.`origin` AS `origin`,
@@ -2226,6 +2234,7 @@ CREATE VIEW `tag-search-view` AS SELECT
        `post-user`.`gravity` AS `gravity`,
        `post-user`.`received` AS `received`,
        `post-user`.`network` AS `network`,
+       `post-user`.`author-id` AS `author-id`,
        `tag`.`name` AS `name`
        FROM `post-tag`
                        INNER JOIN `tag` ON `tag`.`id` = `post-tag`.`tid`