]> git.mxchange.org Git - friendica.git/blobdiff - static/dbstructure.config.php
OAuth connections now have to be ackknowledged
[friendica.git] / static / dbstructure.config.php
index 91356a018d372213353c704712aedaeb4c7c85f6..41515681e4a17a9050d624f13001a885f18e82a7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1409);
+       define('DB_UPDATE_VERSION', 1416);
 }
 
 return [
@@ -256,6 +256,9 @@ return [
                        "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
                        "uid_lastitem" => ["uid", "last-item"],
                        "baseurl" => ["baseurl(64)"],
+                       "uid_contact-type" => ["uid", "contact-type"],
+                       "uid_self_contact-type" => ["uid", "self", "contact-type"],
+                       "self_network_uid" => ["self", "network", "uid"],
                        "gsid" => ["gsid"]
                ]
        ],
@@ -423,6 +426,36 @@ return [
                        "gsid" => ["gsid"]
                ]
        ],
+       "application" => [
+               "comment" => "OAuth application",
+               "fields" => [
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
+                       "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
+                       "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
+                       "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
+                       "redirect_uri" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
+                       "website" => ["type" => "varchar(255)", "comment" => ""],
+                       "scopes" => ["type" => "varchar(255)", "comment" => ""],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "client_id" => ["UNIQUE", "client_id"]
+               ]
+       ],
+       "application-token" => [
+               "comment" => "OAuth user token",
+               "fields" => [
+                       "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
+                       "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
+                       "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
+                       "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
+                       "created_at" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["application-id", "uid"],
+                       "uid_id" => ["uid", "application-id"],
+               ]
+       ],
        "attach" => [
                "comment" => "file attachments",
                "fields" => [
@@ -995,7 +1028,7 @@ return [
                        "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
                        "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
                        "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
-                       "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
+                       "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
                        "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
                        "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
                        "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1089,6 +1122,13 @@ return [
                        "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
                        "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
                        "description" => ["type" => "text", "comment" => ""],
+                       "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
+                       "author-url" => ["type" => "varbinary(255)", "comment" => "URL of the author of the media"],
+                       "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
+                       "author-image" => ["type" => "varbinary(255)", "comment" => "Image of the author of the media"],
+                       "publisher-url" => ["type" => "varbinary(255)", "comment" => "URL of the publisher of the media"],
+                       "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
+                       "publisher-image" => ["type" => "varbinary(255)", "comment" => "Image of the publisher of the media"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -1119,7 +1159,7 @@ return [
                        "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
                        "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                        "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],                        
+                       "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
                        "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
                ],
                "indexes" => [
@@ -1147,7 +1187,8 @@ return [
                        "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
                        "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
                        "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
-                       "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
+                       "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
+                       "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
                        "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
                        "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
                        "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1184,6 +1225,7 @@ return [
                        "uid_contactid" => ["uid", "contact-id"],
                        "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
                        "uid_unseen" => ["uid", "unseen"],
+                       "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
                ],
        ],
        "post-thread-user" => [