]> git.mxchange.org Git - friendica.git/commitdiff
[Database 1529] Add author baseurl to post-user-view
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 24 Aug 2023 11:48:35 +0000 (07:48 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 25 Aug 2023 13:30:23 +0000 (09:30 -0400)
- Explicit the contact.baseurl and contact.gsid caveat

database.sql
doc/database/db_contact.md
static/dbstructure.config.php
static/dbview.config.php

index 89a80b170b5dfae8b8475e51cac1e122a285cabb..bc73b5ac088ade5a433147c39964faa72e12a331 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2023.09-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1528
+-- DB_UPDATE_VERSION 1529
 -- ------------------------------------------
 
 
@@ -173,8 +173,8 @@ CREATE TABLE IF NOT EXISTS `contact` (
        `archive` boolean NOT NULL DEFAULT '0' COMMENT '',
        `unsearchable` boolean NOT NULL DEFAULT '0' COMMENT 'Contact prefers to not be searchable',
        `sensitive` boolean NOT NULL DEFAULT '0' COMMENT 'Contact posts sensitive content',
-       `baseurl` varbinary(383) DEFAULT '' COMMENT 'baseurl of the contact',
-       `gsid` int unsigned COMMENT 'Global Server ID',
+       `baseurl` varbinary(383) DEFAULT '' COMMENT 'baseurl of the contact from the gserver record, can be missing',
+       `gsid` int unsigned COMMENT 'Global Server ID, can be missing',
        `bd` date NOT NULL DEFAULT '0001-01-01' COMMENT '',
        `reason` text COMMENT '',
        `self` boolean NOT NULL DEFAULT '0' COMMENT '1 if the contact is the user him/her self',
@@ -2045,6 +2045,7 @@ CREATE VIEW `post-user-view` AS SELECT
        `author`.`hidden` AS `author-hidden`,
        `author`.`updated` AS `author-updated`,
        `author`.`gsid` AS `author-gsid`,
+       `author`.`baseurl` AS `author-baseurl`,
        `post-user`.`owner-id` AS `owner-id`,
        `owner`.`uri-id` AS `owner-uri-id`,
        `owner`.`url` AS `owner-link`,
index 496210067a102d949ac55a445240dee91991f689..8221f279e271418fae472c03a76dcdf749d524f8 100644 (file)
@@ -51,8 +51,8 @@ Fields
 | archive                   |                                                                                                                | boolean            | NO   |     | 0                   |                |
 | unsearchable              | Contact prefers to not be searchable                                                                           | boolean            | NO   |     | 0                   |                |
 | sensitive                 | Contact posts sensitive content                                                                                | boolean            | NO   |     | 0                   |                |
-| baseurl                   | baseurl of the contact                                                                                         | varbinary(383)     | YES  |     |                     |                |
-| gsid                      | Global Server ID                                                                                               | int unsigned       | YES  |     | NULL                |                |
+| baseurl                   | baseurl of the contact from the gserver record, can be missing                                                 | varbinary(383)     | YES  |     |                     |                |
+| gsid                      | Global Server ID, can be missing                                                                               | int unsigned       | YES  |     | NULL                |                |
 | bd                        |                                                                                                                | date               | NO   |     | 0001-01-01          |                |
 | reason                    |                                                                                                                | text               | YES  |     | NULL                |                |
 | self                      | 1 if the contact is the user him/her self                                                                      | boolean            | NO   |     | 0                   |                |
index cef6855364e936514e7ac27a1e1df0a51f6a6da9..71c7d5cb1d4db15126876a523e6f8b382973c711 100644 (file)
@@ -56,7 +56,7 @@ use Friendica\Database\DBA;
 
 // This file is required several times during the test in DbaDefinition which justifies this condition
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1528);
+       define('DB_UPDATE_VERSION', 1529);
 }
 
 return [
@@ -230,8 +230,8 @@ return [
                        "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
                        "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
-                       "baseurl" => ["type" => "varbinary(383)", "default" => "", "comment" => "baseurl of the contact"],
-                       "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
+                       "baseurl" => ["type" => "varbinary(383)", "default" => "", "comment" => "baseurl of the contact from the gserver record, can be missing"],
+                       "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID, can be missing"],
                        "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
                        // User depending fields
                        "reason" => ["type" => "text", "comment" => ""],
index 5da17a42e70aa22b5c41acedc994ac4205d6b254..ed120e55e5616f90c33ee84c3ce34bfd3e8acc55 100644 (file)
                        "author-hidden" => ["author", "hidden"],
                        "author-updated" => ["author", "updated"],
                        "author-gsid" => ["author", "gsid"],
+                       "author-baseurl" => ["author", "baseurl"],
                        "owner-id" => ["post-user", "owner-id"],
                        "owner-uri-id" => ["owner", "uri-id"],
                        "owner-link" => ["owner", "url"],