Updated database.sql

This commit is contained in:
Michael 2021-02-20 20:51:08 +00:00
parent 92a8a399de
commit abf7cbcc45

View file

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 2021.03-dev (Red Hot Poker) -- Friendica 2021.03-dev (Red Hot Poker)
-- DB_UPDATE_VERSION 1404 -- DB_UPDATE_VERSION 1405
-- ------------------------------------------ -- ------------------------------------------
@ -936,7 +936,6 @@ CREATE TABLE IF NOT EXISTS `post` (
INDEX `author-id` (`author-id`), INDEX `author-id` (`author-id`),
INDEX `causer-id` (`causer-id`), INDEX `causer-id` (`causer-id`),
INDEX `vid` (`vid`), INDEX `vid` (`vid`),
INDEX `received` (`received`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`parent-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`parent-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`thr-parent-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`thr-parent-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
@ -1057,7 +1056,6 @@ CREATE TABLE IF NOT EXISTS `post-thread` (
`network` char(4) NOT NULL DEFAULT '' COMMENT '', `network` char(4) NOT NULL DEFAULT '' COMMENT '',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
`changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date that something in the conversation changed, indicating clients should fetch the conversation again',
`commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
PRIMARY KEY(`uri-id`), PRIMARY KEY(`uri-id`),
INDEX `owner-id` (`owner-id`), INDEX `owner-id` (`owner-id`),
@ -1108,26 +1106,24 @@ CREATE TABLE IF NOT EXISTS `post-user` (
PRIMARY KEY(`id`), PRIMARY KEY(`id`),
UNIQUE INDEX `uid_uri-id` (`uid`,`uri-id`), UNIQUE INDEX `uid_uri-id` (`uid`,`uri-id`),
INDEX `uri-id` (`uri-id`), INDEX `uri-id` (`uri-id`),
INDEX `contact-id` (`contact-id`), INDEX `parent-uri-id` (`parent-uri-id`),
INDEX `psid` (`psid`),
INDEX `uid_hidden` (`uid`,`hidden`),
INDEX `event-id` (`event-id`),
INDEX `uid_wall` (`uid`,`wall`),
INDEX `parent-uri-id_uid` (`parent-uri-id`,`uid`),
INDEX `thr-parent-id` (`thr-parent-id`), INDEX `thr-parent-id` (`thr-parent-id`),
INDEX `external-id` (`external-id`), INDEX `external-id` (`external-id`),
INDEX `owner-id` (`owner-id`), INDEX `owner-id` (`owner-id`),
INDEX `author-id_uid` (`author-id`,`uid`), INDEX `author-id` (`author-id`),
INDEX `causer-id` (`causer-id`), INDEX `causer-id` (`causer-id`),
INDEX `vid` (`vid`), INDEX `vid` (`vid`),
INDEX `uid_received` (`uid`,`received`), INDEX `contact-id` (`contact-id`),
INDEX `event-id` (`event-id`),
INDEX `psid` (`psid`),
INDEX `author-id_uid` (`author-id`,`uid`),
INDEX `author-id_received` (`author-id`,`received`),
INDEX `parent-uri-id_uid` (`parent-uri-id`,`uid`),
INDEX `uid_hidden` (`uid`,`hidden`),
INDEX `uid_contactid` (`uid`,`contact-id`),
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`), INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
INDEX `uid_network_received` (`uid`,`network`,`received`), INDEX `uid_unseen` (`uid`,`unseen`),
INDEX `uid_contactid_received` (`uid`,`contact-id`,`received`),
INDEX `authorid_received` (`author-id`,`received`),
INDEX `uid_unseen_wall` (`uid`,`unseen`,`wall`), INDEX `uid_unseen_wall` (`uid`,`unseen`,`wall`),
INDEX `uid_eventid` (`uid`,`event-id`),
INDEX `psid_wall` (`psid`,`wall`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`parent-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`parent-uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`thr-parent-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`thr-parent-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
@ -1170,30 +1166,21 @@ CREATE TABLE IF NOT EXISTS `post-thread-user` (
`psid` int unsigned COMMENT 'ID of the permission set of this post', `psid` int unsigned COMMENT 'ID of the permission set of this post',
`post-user-id` int unsigned COMMENT 'Id of the post-user table', `post-user-id` int unsigned COMMENT 'Id of the post-user table',
PRIMARY KEY(`uid`,`uri-id`), PRIMARY KEY(`uid`,`uri-id`),
INDEX `uid_wall` (`uid`,`wall`),
INDEX `uid_pinned` (`uid`,`pinned`),
INDEX `uri-id` (`uri-id`), INDEX `uri-id` (`uri-id`),
INDEX `owner-id` (`owner-id`),
INDEX `author-id` (`author-id`),
INDEX `causer-id` (`causer-id`),
INDEX `uid` (`uid`),
INDEX `contact-id` (`contact-id`), INDEX `contact-id` (`contact-id`),
INDEX `psid` (`psid`), INDEX `psid` (`psid`),
INDEX `post-user-id` (`post-user-id`), INDEX `post-user-id` (`post-user-id`),
INDEX `owner-id` (`owner-id`),
INDEX `causer-id` (`causer-id`),
INDEX `uid_received` (`uid`,`received`),
INDEX `uid_commented` (`uid`,`commented`),
INDEX `uid_changed` (`uid`,`changed`),
INDEX `uid_contact-id` (`uid`,`contact-id`,`received`),
INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
INDEX `uid_network_received` (`uid`,`network`,`received`),
INDEX `uid_network_commented` (`uid`,`network`,`commented`),
INDEX `uid_contact-id_received` (`uid`,`contact-id`,`received`),
INDEX `author-id_received` (`author-id`,`received`),
INDEX `uid_wall_changed` (`uid`,`wall`,`changed`),
INDEX `uid_unseen_wall` (`uid`,`unseen`,`wall`),
INDEX `mention_uid` (`mention`,`uid`),
INDEX `psid_wall` (`psid`,`wall`),
INDEX `received` (`received`),
INDEX `commented` (`commented`), INDEX `commented` (`commented`),
INDEX `changed` (`changed`), INDEX `received` (`received`),
INDEX `author-id_received` (`author-id`,`received`),
INDEX `uid_pinned` (`uid`,`pinned`),
INDEX `uid_commented` (`uid`,`commented`),
INDEX `mention_uid` (`mention`,`uid`),
INDEX `uid_mention` (`uid`,`mention`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`owner-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, FOREIGN KEY (`owner-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT,
FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT,
@ -1563,6 +1550,7 @@ CREATE VIEW `post-view` AS SELECT
`owner`.`network` AS `owner-network`, `owner`.`network` AS `owner-network`,
`owner`.`blocked` AS `owner-blocked`, `owner`.`blocked` AS `owner-blocked`,
`owner`.`hidden` AS `owner-hidden`, `owner`.`hidden` AS `owner-hidden`,
`owner`.`contact-type` AS `owner-contact-type`,
`post-user`.`causer-id` AS `causer-id`, `post-user`.`causer-id` AS `causer-id`,
`causer`.`url` AS `causer-link`, `causer`.`url` AS `causer-link`,
`causer`.`addr` AS `causer-addr`, `causer`.`addr` AS `causer-addr`,
@ -1720,6 +1708,7 @@ CREATE VIEW `post-thread-view` AS SELECT
`owner`.`network` AS `owner-network`, `owner`.`network` AS `owner-network`,
`owner`.`blocked` AS `owner-blocked`, `owner`.`blocked` AS `owner-blocked`,
`owner`.`hidden` AS `owner-hidden`, `owner`.`hidden` AS `owner-hidden`,
`owner`.`contact-type` AS `owner-contact-type`,
`post-thread-user`.`causer-id` AS `causer-id`, `post-thread-user`.`causer-id` AS `causer-id`,
`causer`.`url` AS `causer-link`, `causer`.`url` AS `causer-link`,
`causer`.`addr` AS `causer-addr`, `causer`.`addr` AS `causer-addr`,