]> git.mxchange.org Git - friendica.git/blobdiff - src/Database/DBStructure.php
Merge branch 'master' into develop
[friendica.git] / src / Database / DBStructure.php
index f4a88871d7a0c8032b5f874232c51f3ba28e637f..c285528e00e1ef43ecc18ba9848c4f632e764b1f 100644 (file)
@@ -199,14 +199,15 @@ class DBStructure
         *
         * @param bool  $verbose
         * @param bool  $action     Whether to actually apply the update
+        * @param bool  $install    Is this the initial update during the installation?
         * @param array $tables     An array of the database tables
         * @param array $definition An array of the definition tables
         * @return string Empty string if the update is successful, error messages otherwise
         */
-       public static function update($verbose, $action, array $tables = null, array $definition = null) {
-               if ($action) {
+       public static function update($verbose, $action, $install = false, array $tables = null, array $definition = null) {
+               if ($action && !$install) {
                        Config::set('system', 'maintenance', 1);
-                       Config::set('system', 'maintenance_reason', L10n::t(': Database update', DBM::date().' '.date('e')));
+                       Config::set('system', 'maintenance_reason', L10n::t('%s: Database update', DBM::date().' '.date('e')));
                }
 
                $errors = '';
@@ -455,7 +456,9 @@ class DBStructure
                                }
 
                                if ($action) {
-                                       Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DBM::date().' '.date('e'), $name));
+                                       if (!$install) {
+                                               Config::set('system', 'maintenance_reason', L10n::t('%s: updating %s table.', DBM::date().' '.date('e'), $name));
+                                       }
 
                                        // Ensure index conversion to unique removes duplicates
                                        if ($is_unique && ($temp_name != $name)) {
@@ -505,15 +508,15 @@ class DBStructure
                        }
                }
 
-               if ($action) {
+               if ($action && !$install) {
                        Config::set('system', 'maintenance', 0);
                        Config::set('system', 'maintenance_reason', '');
-               }
 
-               if ($errors) {
-                       Config::set('system', 'dbupdate', DB_UPDATE_FAILED);
-               } else {
-                       Config::set('system', 'dbupdate', DB_UPDATE_SUCCESSFUL);
+                       if ($errors) {
+                               Config::set('system', 'dbupdate', DB_UPDATE_FAILED);
+                       } else {
+                               Config::set('system', 'dbupdate', DB_UPDATE_SUCCESSFUL);
+                       }
                }
 
                return $errors;
@@ -665,12 +668,12 @@ class DBStructure
                                "comment" => "registered addons",
                                "fields" => [
                                                "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
+                                               "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
+                                               "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
+                                               "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
+                                               "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
+                                               "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -680,19 +683,19 @@ class DBStructure
                $database["attach"] = [
                                "comment" => "file attachments",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "data" => ["type" => "longblob", "not null" => "1", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "allow_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "allow_gid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
+                                               "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
+                                               "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
+                                               "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
+                                               "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time"],
+                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edit time"],
+                                               "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
+                                               "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
+                                               "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
+                                               "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -712,22 +715,22 @@ class DBStructure
                                                ]
                                ];
                $database["cache"] = [
-                               "comment" => "Used to store different data that doesn't to be stored for a long time",
+                               "comment" => "Stores temporary data",
                                "fields" => [
-                                               "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
-                                               "v" => ["type" => "mediumtext", "comment" => ""],
-                                               "expire_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
+                                               "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
+                                               "expires" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of cache expiration"],
+                                               "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of cache insertion"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["k"],
-                                               "expire_mode_updated" => ["expire_mode", "updated"],
+                                               "k_expires" => ["k", "expires"],
                                                ]
                                ];
                $database["challenge"] = [
                                "comment" => "",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -768,26 +771,26 @@ class DBStructure
                $database["contact"] = [
                                "comment" => "contact table",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
                                                "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
                                                "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
                                                "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network protocol of the contact"],
+                                               "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
+                                               "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
                                                "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "about" => ["type" => "text", "comment" => ""],
-                                               "keywords" => ["type" => "text", "comment" => ""],
+                                               "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
                                                "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
                                                "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "micro" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
+                                               "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
+                                               "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
                                                "site-pubkey" => ["type" => "text", "comment" => ""],
                                                "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -795,8 +798,8 @@ class DBStructure
                                                "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "pubkey" => ["type" => "text", "comment" => ""],
-                                               "prvkey" => ["type" => "text", "comment" => ""],
+                                               "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
+                                               "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
                                                "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "request" => ["type" => "varchar(255)", "comment" => ""],
                                                "notify" => ["type" => "varchar(255)", "comment" => ""],
@@ -808,20 +811,20 @@ class DBStructure
                                                "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "last-update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "last-update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last try to update the contact info"],
+                                               "success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last successful contact update"],
+                                               "failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last failed update"],
                                                "name-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "uri-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "term-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "last-item" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "last-item" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "date of the last post"],
                                                "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                                                "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
-                                               "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
                                                "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
+                                               "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
                                                "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
                                                "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@@ -856,14 +859,14 @@ class DBStructure
                $database["conv"] = [
                                "comment" => "private messages",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "recips" => ["type" => "text", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "subject" => ["type" => "text", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
+                                               "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation timestamp"],
+                                               "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "edited timestamp"],
+                                               "subject" => ["type" => "text", "comment" => "subject of initial message"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -873,13 +876,13 @@ class DBStructure
                $database["conversation"] = [
                                "comment" => "Raw data and structure information for messages",
                                "fields" => [
-                                               "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
-                                               "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "source" => ["type" => "mediumtext", "comment" => ""],
-                                               "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URI of the item"],
+                                               "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
+                                               "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
+                                               "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
+                                               "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The protocol of the item"],
+                                               "source" => ["type" => "mediumtext", "comment" => "Original source"],
+                                               "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Receiving date"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["item-uri"],
@@ -890,26 +893,26 @@ class DBStructure
                $database["event"] = [
                                "comment" => "Events",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
                                                "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "summary" => ["type" => "text", "comment" => ""],
-                                               "desc" => ["type" => "text", "comment" => ""],
-                                               "location" => ["type" => "text", "comment" => ""],
-                                               "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
-                                               "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "allow_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "allow_gid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time"],
+                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edit time"],
+                                               "start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "event start time"],
+                                               "finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "event end time"],
+                                               "summary" => ["type" => "text", "comment" => "short description or title of the event"],
+                                               "desc" => ["type" => "text", "comment" => "event description"],
+                                               "location" => ["type" => "text", "comment" => "event location"],
+                                               "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
+                                               "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
+                                               "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
+                                               "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
+                                               "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
+                                               "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
+                                               "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
+                                               "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -919,8 +922,8 @@ class DBStructure
                $database["fcontact"] = [
                                "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
                                                "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -963,9 +966,9 @@ class DBStructure
                $database["gcign"] = [
                                "comment" => "contacts ignored by friend suggestions",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
+                                               "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -976,12 +979,12 @@ class DBStructure
                $database["gcontact"] = [
                                "comment" => "global contacts",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
+                                               "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
+                                               "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
                                                "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
                                                "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "updated" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
@@ -989,19 +992,19 @@ class DBStructure
                                                "last_failure" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
                                                "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "about" => ["type" => "text", "comment" => ""],
-                                               "keywords" => ["type" => "text", "comment" => ""],
+                                               "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
                                                "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
                                                "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""],
-                                               "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
                                                "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
-                                               "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
+                                               "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
+                                               "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
                                                "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "notify" => ["type" => "varchar(255)", "comment" => ""],
                                                "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1016,7 +1019,7 @@ class DBStructure
                $database["glink"] = [
                                "comment" => "'friends of friends' linkages derived from poco",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
@@ -1032,11 +1035,11 @@ class DBStructure
                $database["group"] = [
                                "comment" => "privacy groups, group info",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
+                                               "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
+                                               "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1046,9 +1049,9 @@ class DBStructure
                $database["group_member"] = [
                                "comment" => "privacy groups, member info",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => ""],
-                                               "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
+                                               "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id  of the member assigned to the associated group"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1059,18 +1062,20 @@ class DBStructure
                $database["gserver"] = [
                                "comment" => "Global servers",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "info" => ["type" => "text", "comment" => ""],
                                                "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
                                                "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
                                                "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
+                                               "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
                                                "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "last_poco_query" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
                                                "last_contact" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
@@ -1081,14 +1086,25 @@ class DBStructure
                                                "nurl" => ["UNIQUE", "nurl(190)"],
                                                ]
                                ];
+               $database["gserver-tag"] = [
+                               "comment" => "Tags that the server has subscribed",
+                               "fields" => [
+                                               "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1", "comment" => "The id of the gserver"],
+                                               "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
+                                               ],
+                               "indexes" => [
+                                               "PRIMARY" => ["gserver-id", "tag"],
+                                               "tag" => ["tag"],
+                                               ]
+                               ];
                $database["hook"] = [
                                "comment" => "addon hook registry",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
+                                               "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
+                                               "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
+                                               "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1098,7 +1114,7 @@ class DBStructure
                $database["intro"] = [
                                "comment" => "",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
                                                "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
@@ -1118,67 +1134,68 @@ class DBStructure
                                "comment" => "All posts",
                                "fields" => [
                                                "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
-                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
                                                "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
+                                               "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
                                                "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
                                                "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
-                                               "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"],
+                                               "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
                                                "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
-                                               "owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
-                                               "author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "body" => ["type" => "mediumtext", "comment" => ""],
-                                               "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "object" => ["type" => "text", "comment" => ""],
-                                               "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "target" => ["type" => "text", "comment" => ""],
-                                               "postopts" => ["type" => "text", "comment" => ""],
-                                               "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => ""],
+                                               "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation timestamp."],
+                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of  last edit (default is created)"],
+                                               "commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last comment/reply to this item"],
+                                               "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime"],
+                                               "changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
+                                               "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
+                                               "owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the owner of this item"],
+                                               "owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile page of the owner of this item"],
+                                               "owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the avatar picture of the owner of this item"],
+                                               "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
+                                               "author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the author of this item"],
+                                               "author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile page of the author of this item"],
+                                               "author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the avatar picture of the author of this item"],
+                                               "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
+                                               "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "body" => ["type" => "mediumtext", "comment" => "item body content"],
+                                               "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
+                                               "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"],
+                                               "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
+                                               "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
+                                               "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
+                                               "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
+                                               "postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"],
+                                               "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL toa displayable copy  of the message at its source"],
+                                               "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"],
+                                               "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
                                                "tag" => ["type" => "mediumtext", "comment" => ""],
-                                               "attach" => ["type" => "mediumtext", "comment" => ""],
+                                               "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
                                                "inform" => ["type" => "mediumtext", "comment" => ""],
                                                "file" => ["type" => "mediumtext", "comment" => ""],
-                                               "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "allow_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "allow_gid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_gid" => ["type" => "mediumtext", "comment" => ""],
-                                               "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
+                                               "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
+                                               "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
+                                               "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
+                                               "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
+                                               "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
+                                               "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
                                                "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
-                                               "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
+                                               "bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been bookmarked"],
+                                               "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
+                                               "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
+                                               "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
                                                "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
+                                               "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
                                                "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "rendered-html" => ["type" => "mediumtext", "comment" => ""],
+                                               "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
                                                "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                ],
                                "indexes" => [
@@ -1215,10 +1232,10 @@ class DBStructure
                $database["locks"] = [
                                "comment" => "",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
                                                "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1227,23 +1244,23 @@ class DBStructure
                $database["mail"] = [
                                "comment" => "private messages",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => ""],
-                                               "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
+                                               "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
+                                               "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
+                                               "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
+                                               "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
+                                               "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
                                                "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "body" => ["type" => "mediumtext", "comment" => ""],
-                                               "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
                                                "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
                                                "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time of the private message"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1257,7 +1274,7 @@ class DBStructure
                $database["mailacct"] = [
                                "comment" => "Mail account data for fetching mails",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1278,7 +1295,7 @@ class DBStructure
                $database["manage"] = [
                                "comment" => "table of accounts that can manage each other",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                ],
@@ -1290,7 +1307,7 @@ class DBStructure
                $database["notify"] = [
                                "comment" => "notifications",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
                                                "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                                                "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -1298,15 +1315,15 @@ class DBStructure
                                                "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "msg" => ["type" => "mediumtext", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
                                                "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
                                                "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
                                                "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
                                                "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "name_cache" => ["type" => "tinytext", "comment" => ""],
-                                               "msg_cache" => ["type" => "mediumtext", "comment" => ""]
+                                               "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
+                                               "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1319,7 +1336,7 @@ class DBStructure
                $database["notify-threads"] = [
                                "comment" => "",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
                                                "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
                                                "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1332,10 +1349,10 @@ class DBStructure
                $database["oembed"] = [
                                "comment" => "cache for OEmbed queries",
                                "fields" => [
-                                               "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
-                                               "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
-                                               "content" => ["type" => "mediumtext", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
+                                               "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
+                                               "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of creation"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["url", "maxwidth"],
@@ -1345,11 +1362,11 @@ class DBStructure
                $database["parsed_url"] = [
                                "comment" => "cache for 'parse_url' queries",
                                "fields" => [
-                                               "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
-                                               "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
-                                               "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
-                                               "content" => ["type" => "mediumtext", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
+                                               "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
+                                               "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
+                                               "content" => ["type" => "mediumtext", "comment" => "page data"],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of creation"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["url", "guessing", "oembed"],
@@ -1385,16 +1402,16 @@ class DBStructure
                $database["photo"] = [
                                "comment" => "photo storage",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
-                                               "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
+                                               "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
                                                "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation date"],
+                                               "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edited date"],
                                                "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "desc" => ["type" => "text", "comment" => ""],
-                                               "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
                                                "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
                                                "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1403,10 +1420,10 @@ class DBStructure
                                                "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
                                                "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                                                "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "allow_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "allow_gid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+                                               "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
+                                               "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
+                                               "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
+                                               "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1442,7 +1459,7 @@ class DBStructure
                $database["poll_result"] = [
                                "comment" => "data for polls - currently unused",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
                                                "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                                                ],
@@ -1466,14 +1483,14 @@ class DBStructure
                $database["profile"] = [
                                "comment" => "user profiles data",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
+                                               "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
+                                               "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
+                                               "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
                                                "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => ""],
+                                               "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
+                                               "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
                                                "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -1506,8 +1523,8 @@ class DBStructure
                                                "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
+                                               "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
@@ -1517,9 +1534,9 @@ class DBStructure
                $database["profile_check"] = [
                                "comment" => "DFRN remote auth use",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                                               "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+                                               "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
                                                "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1531,23 +1548,26 @@ class DBStructure
                $database["push_subscriber"] = [
                                "comment" => "Used for OStatus: Contains feed subscribers",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "push" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "last_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
+                                               "last_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last successful trial"],
+                                               "next_try" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Next retrial date"],
+                                               "renewed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last subscription renewal"],
                                                "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
+                                               "next_try" => ["next_try"],
                                                ]
                                ];
                $database["queue"] = [
                                "comment" => "Queue for messages that couldn't be delivered",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
                                                "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
                                                "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
@@ -1567,7 +1587,7 @@ class DBStructure
                $database["register"] = [
                                "comment" => "registrations requiring admin approval",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
@@ -1582,7 +1602,7 @@ class DBStructure
                $database["search"] = [
                                "comment" => "",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                ],
@@ -1594,7 +1614,7 @@ class DBStructure
                $database["session"] = [
                                "comment" => "web session storage",
                                "fields" => [
-                                               "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
                                                "data" => ["type" => "text", "comment" => ""],
                                                "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1608,8 +1628,8 @@ class DBStructure
                $database["sign"] = [
                                "comment" => "Diaspora signatures",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
-                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
                                                "signed_text" => ["type" => "mediumtext", "comment" => ""],
                                                "signature" => ["type" => "text", "comment" => ""],
                                                "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -1646,11 +1666,11 @@ class DBStructure
                $database["thread"] = [
                                "comment" => "Thread related data",
                                "fields" => [
-                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
+                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "sequential ID"],
                                                "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                                                "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
-                                               "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
-                                               "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+                                               "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
+                                               "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
                                                "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
                                                "commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
@@ -1704,50 +1724,50 @@ class DBStructure
                $database["user"] = [
                                "comment" => "The local users",
                                "fields" => [
-                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "The parent user that has full control about this user"],
-                                               "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
+                                               "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
+                                               "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
                                                "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
-                                               "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                                               "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
+                                               "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
                                                "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => ""],
-                                               "register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                                               "pubkey" => ["type" => "text", "comment" => ""],
-                                               "prvkey" => ["type" => "text", "comment" => ""],
+                                               "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
+                                               "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
+                                               "register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of registration"],
+                                               "login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of last login"],
+                                               "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
+                                               "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
+                                               "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
+                                               "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
+                                               "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
                                                "spubkey" => ["type" => "text", "comment" => ""],
                                                "sprvkey" => ["type" => "text", "comment" => ""],
-                                               "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
+                                               "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
+                                               "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
+                                               "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
+                                               "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
+                                               "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
                                                "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
-                                               "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => ""],
-                                               "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
+                                               "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
                                                "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                                                "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                                                "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
                                                "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
                                                "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
                                                "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                                               "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
                                                "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
-                                               "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+                                               "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp when account expires and will be deleted"],
+                                               "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of last warning of account expiration"],
                                                "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                                               "allow_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "allow_gid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_cid" => ["type" => "mediumtext", "comment" => ""],
-                                               "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+                                               "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
+                                               "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
+                                               "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
+                                               "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
                                                "openidserver" => ["type" => "text", "comment" => ""],
                                                ],
                                "indexes" => [
@@ -1758,7 +1778,7 @@ class DBStructure
                $database["userd"] = [
                                "comment" => "Deleted usernames",
                                "fields" => [
-                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+                                               "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                                                "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
                                                ],
                                "indexes" => [
@@ -1766,6 +1786,17 @@ class DBStructure
                                                "username" => ["username(32)"],
                                                ]
                                ];
+               $database["user-item"] = [
+                               "comment" => "User specific item data",
+                               "fields" => [
+                                               "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
+                                               "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
+                                               "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
+                                               ],
+                               "indexes" => [
+                                               "PRIMARY" => ["uid", "iid"],
+                                               ]
+                               ];
                $database["workerqueue"] = [
                                "comment" => "Background tasks queue entries",
                                "fields" => [
@@ -1775,17 +1806,19 @@ class DBStructure
                                                "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation date"],
                                                "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
                                                "executed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Execution date"],
-                                               "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked when the task was done, will be deleted later"],
+                                               "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
                                                ],
                                "indexes" => [
                                                "PRIMARY" => ["id"],
                                                "pid" => ["pid"],
                                                "parameter" => ["parameter(64)"],
                                                "priority_created" => ["priority", "created"],
-                                               "executed" => ["executed"],
+                                               "done_executed" => ["done", "executed"],
                                                ]
                                ];
 
+               \Friendica\Core\Addon::callHooks('dbstructure_definition', $database);
+
                return $database;
        }
 }