]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Measures against several warnings and errors in the log
[friendica.git] / database.sql
index 35831813469b5397b64fb9a626f30cca2184a7da..ebae144365006b79c9a70c1ec3ce0fa08dca34dd 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
--- Friendica 2022.12-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1498
+-- Friendica 2022.12-rc (Giant Rhubarb)
+-- DB_UPDATE_VERSION 1502
 -- ------------------------------------------
 
 
@@ -129,6 +129,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
        `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT 'XMPP address',
        `matrix` varchar(255) NOT NULL DEFAULT '' COMMENT 'Matrix address',
        `avatar` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
+       `blurhash` varbinary(255) COMMENT 'BlurHash representation of the avatar',
        `header` varbinary(383) COMMENT 'Header picture',
        `url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
        `nurl` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
@@ -667,39 +668,6 @@ CREATE TABLE IF NOT EXISTS `event` (
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Events';
 
---
--- TABLE fcontact
---
-CREATE TABLE IF NOT EXISTS `fcontact` (
-       `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
-       `guid` varbinary(255) NOT NULL DEFAULT '' COMMENT 'unique id',
-       `url` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `uri-id` int unsigned COMMENT 'Id of the item-uri table entry that contains the fcontact url',
-       `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
-       `photo` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `request` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
-       `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
-       `batch` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `notify` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `poll` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `confirm` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
-       `network` char(4) NOT NULL DEFAULT '' COMMENT '',
-       `alias` varbinary(383) NOT NULL DEFAULT '' COMMENT '',
-       `pubkey` text COMMENT '',
-       `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
-       `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
-       `interacting_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts this contact interactes with',
-       `interacted_count` int unsigned DEFAULT 0 COMMENT 'Number of contacts that interacted with this contact',
-       `post_count` int unsigned DEFAULT 0 COMMENT 'Number of posts and comments',
-        PRIMARY KEY(`id`),
-        INDEX `addr` (`addr`(32)),
-        UNIQUE INDEX `url` (`url`(190)),
-        UNIQUE INDEX `uri-id` (`uri-id`),
-       FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
-) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Diaspora compatible contacts - used in the Diaspora implementation';
-
 --
 -- TABLE fetch-entry
 --
@@ -1330,6 +1298,9 @@ CREATE TABLE IF NOT EXISTS `post-link` (
        `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
        `url` varbinary(511) NOT NULL COMMENT 'External URL',
        `mimetype` varchar(60) COMMENT '',
+       `height` smallint unsigned COMMENT 'Height of the media',
+       `width` smallint unsigned COMMENT 'Width of the media',
+       `blurhash` varbinary(255) COMMENT 'BlurHash representation of the link',
         PRIMARY KEY(`id`),
         UNIQUE INDEX `uri-id-url` (`uri-id`,`url`),
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
@@ -2836,11 +2807,11 @@ CREATE VIEW `account-view` AS SELECT
        `contact`.`blocked` AS `blocked`,
        `contact`.`notify` AS `dfrn-notify`,
        `contact`.`poll` AS `dfrn-poll`,
-       `fcontact`.`guid` AS `diaspora-guid`,
-       `fcontact`.`batch` AS `diaspora-batch`,
-       `fcontact`.`notify` AS `diaspora-notify`,
-       `fcontact`.`poll` AS `diaspora-poll`,
-       `fcontact`.`alias` AS `diaspora-alias`,
+       `item-uri`.`guid` AS `diaspora-guid`,
+       `diaspora-contact`.`batch` AS `diaspora-batch`,
+       `diaspora-contact`.`notify` AS `diaspora-notify`,
+       `diaspora-contact`.`poll` AS `diaspora-poll`,
+       `diaspora-contact`.`alias` AS `diaspora-alias`,
        `apcontact`.`uuid` AS `ap-uuid`,
        `apcontact`.`type` AS `ap-type`,
        `apcontact`.`following` AS `ap-following`,
@@ -2858,7 +2829,7 @@ CREATE VIEW `account-view` AS SELECT
        FROM `contact`
                        LEFT JOIN `item-uri` ON `item-uri`.`id` = `contact`.`uri-id`
                        LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `contact`.`uri-id`
-                       LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = contact.`uri-id`
+                       LEFT JOIN `diaspora-contact` ON `diaspora-contact`.`uri-id` = contact.`uri-id`
                        LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`
                        WHERE `contact`.`uid` = 0;
 
@@ -2937,14 +2908,14 @@ CREATE VIEW `account-user-view` AS SELECT
        `ucontact`.`reason` AS `reason`,
        `contact`.`notify` AS `dfrn-notify`,
        `contact`.`poll` AS `dfrn-poll`,
-       `fcontact`.`guid` AS `diaspora-guid`,
-       `fcontact`.`batch` AS `diaspora-batch`,
-       `fcontact`.`notify` AS `diaspora-notify`,
-       `fcontact`.`poll` AS `diaspora-poll`,
-       `fcontact`.`alias` AS `diaspora-alias`,
-       `fcontact`.`interacting_count` AS `diaspora-interacting_count`,
-       `fcontact`.`interacted_count` AS `diaspora-interacted_count`,
-       `fcontact`.`post_count` AS `diaspora-post_count`,
+       `item-uri`.`guid` AS `diaspora-guid`,
+       `diaspora-contact`.`batch` AS `diaspora-batch`,
+       `diaspora-contact`.`notify` AS `diaspora-notify`,
+       `diaspora-contact`.`poll` AS `diaspora-poll`,
+       `diaspora-contact`.`alias` AS `diaspora-alias`,
+       `diaspora-contact`.`interacting_count` AS `diaspora-interacting_count`,
+       `diaspora-contact`.`interacted_count` AS `diaspora-interacted_count`,
+       `diaspora-contact`.`post_count` AS `diaspora-post_count`,
        `apcontact`.`uuid` AS `ap-uuid`,
        `apcontact`.`type` AS `ap-type`,
        `apcontact`.`following` AS `ap-following`,
@@ -2963,7 +2934,7 @@ CREATE VIEW `account-user-view` AS SELECT
                        INNER JOIN `contact` ON `contact`.`uri-id` = `ucontact`.`uri-id` AND `contact`.`uid` = 0
                        LEFT JOIN `item-uri` ON `item-uri`.`id` = `ucontact`.`uri-id`
                        LEFT JOIN `apcontact` ON `apcontact`.`uri-id` = `ucontact`.`uri-id`
-                       LEFT JOIN `fcontact` ON `fcontact`.`uri-id` = `ucontact`.`uri-id` AND `fcontact`.`network` = 'dspr'
+                       LEFT JOIN `diaspora-contact` ON `diaspora-contact`.`uri-id` = `ucontact`.`uri-id`
                        LEFT JOIN `gserver` ON `gserver`.`id` = contact.`gsid`;
 
 --