]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
First draft for using a image grid to display attached images.
[friendica.git] / database.sql
index 4e940b3197f9d3dc9f48abc91f84fbef337a6d3b..7b3156f6f7c8d4cab53fa3898ca4759836b7eb5b 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2022.12-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1495
+-- DB_UPDATE_VERSION 1497
 -- ------------------------------------------
 
 
@@ -59,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `user` (
        `language` varchar(32) NOT NULL DEFAULT 'en' COMMENT 'default language',
        `register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of registration',
        `login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'timestamp of last login',
+       `last-activity` date COMMENT 'Day of the last activity',
        `default-location` varchar(255) NOT NULL DEFAULT '' COMMENT 'Default for item.location',
        `allow_location` boolean NOT NULL DEFAULT '0' COMMENT '1 allows to display the location',
        `theme` varchar(255) NOT NULL DEFAULT '' COMMENT 'user theme preference',
@@ -309,6 +310,20 @@ CREATE TABLE IF NOT EXISTS `2fa_trusted_browser` (
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Two-factor authentication trusted browsers';
 
+--
+-- TABLE account-suggestion
+--
+CREATE TABLE IF NOT EXISTS `account-suggestion` (
+       `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the account url',
+       `uid` mediumint unsigned NOT NULL COMMENT 'User ID',
+       `level` smallint unsigned COMMENT 'level of closeness',
+       `ignore` boolean NOT NULL DEFAULT '0' COMMENT 'If set, this account will not be suggested again',
+        PRIMARY KEY(`uid`,`uri-id`),
+        INDEX `uri-id_uid` (`uri-id`,`uid`),
+       FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+       FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Account suggestion';
+
 --
 -- TABLE account-user
 --
@@ -1073,6 +1088,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
        `height` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
        `width` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
        `datasize` int unsigned NOT NULL DEFAULT 0 COMMENT '',
+       `blurhash` varbinary(255) COMMENT 'BlurHash representation of the photo',
        `data` mediumblob NOT NULL COMMENT '',
        `scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
        `profile` boolean NOT NULL DEFAULT '0' COMMENT '',
@@ -1298,6 +1314,7 @@ CREATE TABLE IF NOT EXISTS `post-media` (
        `height` smallint unsigned COMMENT 'Height of the media',
        `width` smallint unsigned COMMENT 'Width of the media',
        `size` bigint unsigned COMMENT 'Media size',
+       `blurhash` varbinary(255) COMMENT 'BlurHash representation of the image',
        `preview` varbinary(512) COMMENT 'Preview URL',
        `preview-height` smallint unsigned COMMENT 'Height of the preview picture',
        `preview-width` smallint unsigned COMMENT 'Width of the preview picture',
@@ -2678,6 +2695,7 @@ CREATE VIEW `owner-view` AS SELECT
        `user`.`language` AS `language`,
        `user`.`register_date` AS `register_date`,
        `user`.`login_date` AS `login_date`,
+       `user`.`last-activity` AS `last-activity`,
        `user`.`default-location` AS `default-location`,
        `user`.`allow_location` AS `allow_location`,
        `user`.`theme` AS `theme`,