3 * @copyright Copyright (C) 2010-2021, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * Main database structure configuration file.
22 * Here are described all the tables, fields and indexes Friendica needs to work.
23 * The entry order is mostly alphabetic - with the exception of tables that are used in foreign keys.
25 * Syntax (braces indicate optionale values):
27 * "comment" => "Description of the table",
30 * "type" => "<field type>{(<field size>)} <unsigned>",
32 * {"extra" => "auto_increment",}
33 * {"default" => "<default value>",}
34 * {"default" => NULL_DATE,} (for datetime fields)
36 * {"foreign|relation" => ["<foreign key table name>" => "<foreign key field name>"],}
37 * "comment" => "Description of the fields"
42 * "PRIMARY" => ["<primary key field name>", ...],
43 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
48 * Whenever possible prefer "foreign" before "relation" with the foreign keys.
49 * "foreign" adds true foreign keys on the database level, while "relation" is just an indicator of a table relation without any consequences
51 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
55 use Friendica\Database\DBA;
57 if (!defined('DB_UPDATE_VERSION')) {
58 define('DB_UPDATE_VERSION', 1426);
64 "comment" => "Global servers",
66 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
67 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
68 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
69 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
71 "info" => ["type" => "text", "comment" => ""],
72 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
73 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
74 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
75 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
76 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
77 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
78 "protocol" => ["type" => "tinyint unsigned", "comment" => "The protocol of the server"],
79 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
80 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
81 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
82 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
83 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
84 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
85 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last successful connection request"],
86 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last failed connection request"],
87 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
88 "next_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Next connection request"],
92 "nurl" => ["UNIQUE", "nurl(190)"],
93 "next_contact" => ["next_contact"],
94 "network" => ["network"],
98 "comment" => "The local users",
100 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
101 "parent-uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"],
102 "comment" => "The parent user that has full control about this user"],
103 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
104 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
105 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
106 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
107 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
108 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
109 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
110 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
111 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
112 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
113 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
114 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
115 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
116 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
117 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
118 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
119 "spubkey" => ["type" => "text", "comment" => ""],
120 "sprvkey" => ["type" => "text", "comment" => ""],
121 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
122 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
123 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
124 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
125 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
126 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
127 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
128 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
129 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
130 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
131 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
132 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
133 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
134 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
135 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
136 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
137 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
138 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
139 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
140 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
141 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
142 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
143 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
144 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
145 "openidserver" => ["type" => "text", "comment" => ""],
148 "PRIMARY" => ["uid"],
149 "nickname" => ["nickname(32)"],
150 "parent-uid" => ["parent-uid"],
152 "email" => ["email(64)"],
156 "comment" => "contact table",
158 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
159 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
160 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
161 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
162 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
163 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
164 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
165 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
166 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
167 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
168 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
169 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
170 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
171 "about" => ["type" => "text", "comment" => ""],
172 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
173 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
174 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
175 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
176 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
177 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
178 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
179 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
180 "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
181 "site-pubkey" => ["type" => "text", "comment" => ""],
182 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
183 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
184 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
185 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
186 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
187 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
188 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
189 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
190 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
191 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
192 "request" => ["type" => "varchar(255)", "comment" => ""],
193 "notify" => ["type" => "varchar(255)", "comment" => ""],
194 "poll" => ["type" => "varchar(255)", "comment" => ""],
195 "confirm" => ["type" => "varchar(255)", "comment" => ""],
196 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
197 "poco" => ["type" => "varchar(255)", "comment" => ""],
198 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
199 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
200 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
201 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
202 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
203 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
204 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
205 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
206 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
207 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
208 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
209 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
210 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
211 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
212 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
213 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
214 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
215 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
216 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
217 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
218 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
219 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
220 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
221 "manually-approve" => ["type" => "boolean", "comment" => ""],
222 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
223 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
224 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
225 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
226 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
227 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
228 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
229 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
230 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
231 "reason" => ["type" => "text", "comment" => ""],
232 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
233 "info" => ["type" => "mediumtext", "comment" => ""],
234 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
235 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
236 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
237 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
238 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
239 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
243 "uid_name" => ["uid", "name(190)"],
244 "self_uid" => ["self", "uid"],
245 "alias_uid" => ["alias(128)", "uid"],
246 "pending_uid" => ["pending", "uid"],
247 "blocked_uid" => ["blocked", "uid"],
248 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
249 "uid_network_batch" => ["uid", "network", "batch(64)"],
250 "batch_contact-type" => ["batch(64)", "contact-type"],
251 "addr_uid" => ["addr(128)", "uid"],
252 "nurl_uid" => ["nurl(128)", "uid"],
253 "nick_uid" => ["nick(128)", "uid"],
254 "attag_uid" => ["attag(96)", "uid"],
255 "dfrn-id" => ["dfrn-id(64)"],
256 "issued-id" => ["issued-id(64)"],
257 "network_uid_lastupdate" => ["network", "uid", "last-update"],
258 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
259 "uid_lastitem" => ["uid", "last-item"],
260 "baseurl" => ["baseurl(64)"],
261 "uid_contact-type" => ["uid", "contact-type"],
262 "uid_self_contact-type" => ["uid", "self", "contact-type"],
263 "self_network_uid" => ["self", "network", "uid"],
265 "uri-id" => ["uri-id"],
269 "comment" => "URI and GUID for items",
271 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
272 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
273 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
277 "uri" => ["UNIQUE", "uri"],
282 "comment" => "tags and mentions",
284 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
285 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
286 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
290 "type_name_url" => ["UNIQUE", "name", "url"],
295 "comment" => "OAuth usage",
297 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
298 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
299 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
300 "name" => ["type" => "text", "comment" => ""],
301 "icon" => ["type" => "text", "comment" => ""],
302 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
305 "PRIMARY" => ["client_id"],
312 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
313 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
314 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
315 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
316 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
317 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
321 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
325 "comment" => "Activity Verbs",
327 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
328 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
336 "2fa_app_specific_password" => [
337 "comment" => "Two-factor app-specific _password",
339 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
340 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
341 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
342 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
343 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
344 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
348 "uid_description" => ["uid", "description(190)"],
351 "2fa_recovery_codes" => [
352 "comment" => "Two-factor authentication recovery codes",
354 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
355 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
356 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
357 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
360 "PRIMARY" => ["uid", "code"]
363 "2fa_trusted_browser" => [
364 "comment" => "Two-factor authentication trusted browsers",
366 "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
367 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
368 "user_agent" => ["type" => "text", "comment" => "User agent string"],
369 "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
370 "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
373 "PRIMARY" => ["cookie_hash"],
378 "comment" => "registered addons",
380 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
381 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
382 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
383 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
384 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
385 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
386 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
390 "installed_name" => ["installed", "name"],
391 "name" => ["UNIQUE", "name"],
395 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
397 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
398 "uuid" => ["type" => "varchar(255)", "comment" => ""],
399 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
400 "following" => ["type" => "varchar(255)", "comment" => ""],
401 "followers" => ["type" => "varchar(255)", "comment" => ""],
402 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
403 "outbox" => ["type" => "varchar(255)", "comment" => ""],
404 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
405 "manually-approve" => ["type" => "boolean", "comment" => ""],
406 "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
407 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
408 "name" => ["type" => "varchar(255)", "comment" => ""],
409 "about" => ["type" => "text", "comment" => ""],
410 "photo" => ["type" => "varchar(255)", "comment" => ""],
411 "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
412 "addr" => ["type" => "varchar(255)", "comment" => ""],
413 "alias" => ["type" => "varchar(255)", "comment" => ""],
414 "pubkey" => ["type" => "text", "comment" => ""],
415 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
416 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
417 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
418 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
419 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
420 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
421 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
422 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
425 "PRIMARY" => ["url"],
426 "addr" => ["addr(32)"],
427 "alias" => ["alias(190)"],
428 "followers" => ["followers(190)"],
429 "baseurl" => ["baseurl(190)"],
430 "sharedinbox" => ["sharedinbox(190)"],
435 "comment" => "OAuth application",
437 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
438 "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
439 "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
440 "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
441 "redirect_uri" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
442 "website" => ["type" => "varchar(255)", "comment" => ""],
443 "scopes" => ["type" => "varchar(255)", "comment" => ""],
444 "read" => ["type" => "boolean", "comment" => "Read scope"],
445 "write" => ["type" => "boolean", "comment" => "Write scope"],
446 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
447 "push" => ["type" => "boolean", "comment" => "Push scope"],
451 "client_id" => ["UNIQUE", "client_id"]
454 "application-token" => [
455 "comment" => "OAuth user token",
457 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
458 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
459 "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
460 "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
461 "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
462 "scopes" => ["type" => "varchar(255)", "comment" => ""],
463 "read" => ["type" => "boolean", "comment" => "Read scope"],
464 "write" => ["type" => "boolean", "comment" => "Write scope"],
465 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
466 "push" => ["type" => "boolean", "comment" => "Push scope"],
469 "PRIMARY" => ["application-id", "uid"],
470 "uid_id" => ["uid", "application-id"],
474 "comment" => "file attachments",
476 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
477 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
478 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
479 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
480 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
481 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
482 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
483 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
484 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
485 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
486 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
487 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
488 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
489 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
490 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
498 "comment" => "OAuth usage",
500 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
501 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
503 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
504 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
505 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
509 "client_id" => ["client_id"]
513 "comment" => "Stores temporary data",
515 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
516 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
517 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
518 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
522 "k_expires" => ["k", "expires"],
528 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
529 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
530 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
531 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
532 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
533 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
537 "expire" => ["expire"],
541 "comment" => "main configuration storage",
543 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
544 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
545 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
546 "v" => ["type" => "mediumtext", "comment" => ""],
550 "cat_k" => ["UNIQUE", "cat", "k"],
553 "contact-relation" => [
554 "comment" => "Contact relations",
556 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
557 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
558 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
559 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
560 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
563 "PRIMARY" => ["cid", "relation-cid"],
564 "relation-cid" => ["relation-cid"],
568 "comment" => "private messages",
570 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
571 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
572 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
573 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
574 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
575 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
576 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
577 "subject" => ["type" => "text", "comment" => "subject of initial message"],
585 "comment" => "Raw data and structure information for messages",
587 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
588 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
589 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
590 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
591 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
592 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
593 "source" => ["type" => "mediumtext", "comment" => "Original source"],
594 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
597 "PRIMARY" => ["item-uri"],
598 "conversation-uri" => ["conversation-uri"],
599 "received" => ["received"],
603 "comment" => "Posts that are about to be distributed at a later time",
605 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
606 "uri" => ["type" => "varchar(255)", "comment" => "URI of the post that will be distributed later"],
607 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
608 "delayed" => ["type" => "datetime", "comment" => "delay time"],
612 "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
615 "diaspora-interaction" => [
616 "comment" => "Signed Diaspora Interaction",
618 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
619 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
622 "PRIMARY" => ["uri-id"]
626 "comment" => "Events",
628 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
629 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
630 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
631 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
632 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
633 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
634 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
635 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
636 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
637 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
638 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
639 "desc" => ["type" => "text", "comment" => "event description"],
640 "location" => ["type" => "text", "comment" => "event location"],
641 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
642 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
643 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
644 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
645 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
646 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
647 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
648 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
652 "uid_start" => ["uid", "start"],
654 "uri-id" => ["uri-id"],
658 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
660 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
661 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
662 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
663 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
664 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
665 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
666 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
667 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
668 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
669 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
670 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
671 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
672 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
673 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
674 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
675 "pubkey" => ["type" => "text", "comment" => ""],
676 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
680 "addr" => ["addr(32)"],
681 "url" => ["UNIQUE", "url(190)"],
685 "comment" => "friend suggestion stuff",
687 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
688 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
689 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
690 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
691 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
692 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
693 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
694 "note" => ["type" => "text", "comment" => ""],
695 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
704 "comment" => "privacy groups, group info",
706 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
707 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
708 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
709 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
710 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
718 "comment" => "privacy groups, member info",
720 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
721 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
722 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
726 "contactid" => ["contact-id"],
727 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
731 "comment" => "Tags that the server has subscribed",
733 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
734 "comment" => "The id of the gserver"],
735 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
738 "PRIMARY" => ["gserver-id", "tag"],
743 "comment" => "addon hook registry",
745 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
746 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
747 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
748 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
749 "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"],
753 "priority" => ["priority"],
754 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
758 "comment" => "Hostname",
760 "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
761 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "The hostname"],
765 "name" => ["UNIQUE", "name"],
769 "comment" => "Status of ActivityPub inboxes",
771 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
772 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
773 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
774 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
775 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
776 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
777 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
786 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
787 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
788 "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => ""],
789 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
790 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
791 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
792 "note" => ["type" => "text", "comment" => ""],
793 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
794 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
795 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
796 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
800 "contact-id" => ["contact-id"],
807 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
808 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
809 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
810 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
811 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
815 "name_expires" => ["name", "expires"]
819 "comment" => "private messages",
821 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
822 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
823 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
824 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
825 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
826 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
827 "contact-id" => ["type" => "varchar(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
828 "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of the mail"],
829 "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
830 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
831 "body" => ["type" => "mediumtext", "comment" => ""],
832 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
833 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
834 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
835 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
836 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
837 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
838 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
839 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
840 "thr-parent" => ["type" => "varchar(255)", "comment" => ""],
841 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
842 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
846 "uid_seen" => ["uid", "seen"],
847 "convid" => ["convid"],
848 "uri" => ["uri(64)"],
849 "parent-uri" => ["parent-uri(64)"],
850 "contactid" => ["contact-id(32)"],
851 "author-id" => ["author-id"],
852 "uri-id" => ["uri-id"],
853 "parent-uri-id" => ["parent-uri-id"],
854 "thr-parent-id" => ["thr-parent-id"],
858 "comment" => "Mail account data for fetching mails",
860 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
861 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
862 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
863 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
864 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
865 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
866 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
867 "pass" => ["type" => "text", "comment" => ""],
868 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
869 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
870 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
871 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
872 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
880 "comment" => "table of accounts that can manage each other",
882 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
883 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
884 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
888 "uid_mid" => ["UNIQUE", "uid", "mid"],
893 "comment" => "notifications",
895 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
896 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
897 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
898 "type" => ["type" => "tinyint unsigned", "comment" => ""],
899 "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
900 "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
901 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
902 "created" => ["type" => "datetime", "comment" => ""],
903 "seen" => ["type" => "boolean", "default" => "0", "comment" => ""],
907 "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
909 "actor-id" => ["actor-id"],
910 "target-uri-id" => ["target-uri-id"],
911 "parent-uri-id" => ["parent-uri-id"],
912 "seen_uid" => ["seen", "uid"],
916 "comment" => "notifications",
918 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
919 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
920 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
921 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
922 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
923 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
924 "msg" => ["type" => "mediumtext", "comment" => ""],
925 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
926 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
927 "iid" => ["type" => "int unsigned", "comment" => ""],
928 "parent" => ["type" => "int unsigned", "comment" => ""],
929 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
930 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
931 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
932 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
933 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
934 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
935 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
939 "seen_uid_date" => ["seen", "uid", "date"],
940 "uid_date" => ["uid", "date"],
941 "uid_type_link" => ["uid", "type", "link(190)"],
942 "uri-id" => ["uri-id"],
943 "parent-uri-id" => ["parent-uri-id"],
946 "notify-threads" => [
949 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
950 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
951 "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
952 "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
953 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
954 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
955 "comment" => "User id"],
959 "master-parent-uri-id" => ["master-parent-uri-id"],
960 "receiver-uid" => ["receiver-uid"],
961 "notify-id" => ["notify-id"],
965 "comment" => "cache for OEmbed queries",
967 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
968 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
969 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
970 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
973 "PRIMARY" => ["url", "maxwidth"],
974 "created" => ["created"],
977 "openwebauth-token" => [
978 "comment" => "Store OpenWebAuth token to verify contacts",
980 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
981 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
982 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
983 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
984 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
985 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
993 "comment" => "cache for 'parse_url' queries",
995 "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
996 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
997 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
998 "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
999 "content" => ["type" => "mediumtext", "comment" => "page data"],
1000 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1001 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
1004 "PRIMARY" => ["url_hash", "guessing", "oembed"],
1005 "created" => ["created"],
1006 "expires" => ["expires"],
1010 "comment" => "personal (per user) configuration storage",
1012 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
1013 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1014 "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
1015 "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1016 "v" => ["type" => "mediumtext", "comment" => "Value"],
1019 "PRIMARY" => ["id"],
1020 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1024 "comment" => "photo storage",
1026 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1027 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1028 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1029 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1030 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1031 "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1032 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1033 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1034 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1035 "desc" => ["type" => "text", "comment" => ""],
1036 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1037 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1038 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1039 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1040 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1041 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1042 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1043 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1044 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1045 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1046 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1047 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1048 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1049 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1050 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1051 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1052 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1055 "PRIMARY" => ["id"],
1056 "contactid" => ["contact-id"],
1057 "uid_contactid" => ["uid", "contact-id"],
1058 "uid_profile" => ["uid", "profile"],
1059 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1060 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1061 "resource-id" => ["resource-id"],
1065 "comment" => "Structure for all posts",
1067 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1068 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1069 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1070 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1071 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1072 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1073 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1074 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1075 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1076 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
1077 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
1078 "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
1079 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1080 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1081 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1082 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1083 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1084 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1087 "PRIMARY" => ["uri-id"],
1088 "parent-uri-id" => ["parent-uri-id"],
1089 "thr-parent-id" => ["thr-parent-id"],
1090 "external-id" => ["external-id"],
1091 "owner-id" => ["owner-id"],
1092 "author-id" => ["author-id"],
1093 "causer-id" => ["causer-id"],
1097 "post-category" => [
1098 "comment" => "post relation to categories",
1100 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1101 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1102 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1103 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1106 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1107 "uri-id" => ["tid"],
1112 "comment" => "Content for all posts",
1114 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1115 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1116 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1117 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1118 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1119 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1120 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1121 "language" => ["type" => "text", "comment" => "Language information about this post"],
1122 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1123 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1124 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1125 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1126 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1127 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1128 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1129 "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"],
1130 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1133 "PRIMARY" => ["uri-id"],
1134 "plink" => ["plink(191)"],
1135 "resource-id" => ["resource-id"],
1136 "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1139 "post-delivery-data" => [
1140 "comment" => "Delivery data for items",
1142 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1143 "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"],
1144 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1145 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1146 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1147 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1148 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1149 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1150 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1151 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1152 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1155 "PRIMARY" => ["uri-id"],
1159 "comment" => "Post related external links",
1161 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1162 "uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1163 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
1164 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1167 "PRIMARY" => ["id"],
1168 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1172 "comment" => "Attached media",
1174 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1175 "uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1176 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "Media URL"],
1177 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1178 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1179 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1180 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1181 "size" => ["type" => "int unsigned", "comment" => "Media size"],
1182 "preview" => ["type" => "varbinary(255)", "comment" => "Preview URL"],
1183 "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1184 "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1185 "description" => ["type" => "text", "comment" => ""],
1186 "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1187 "author-url" => ["type" => "varbinary(255)", "comment" => "URL of the author of the media"],
1188 "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1189 "author-image" => ["type" => "varbinary(255)", "comment" => "Image of the author of the media"],
1190 "publisher-url" => ["type" => "varbinary(255)", "comment" => "URL of the publisher of the media"],
1191 "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1192 "publisher-image" => ["type" => "varbinary(255)", "comment" => "Image of the publisher of the media"],
1195 "PRIMARY" => ["id"],
1196 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1200 "comment" => "post relation to tags",
1202 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1203 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1204 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1205 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Contact id of the mentioned public contact"],
1208 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1214 "comment" => "Thread related data",
1216 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1217 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1218 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1219 "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
1220 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1221 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1222 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1223 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
1224 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1227 "PRIMARY" => ["uri-id"],
1228 "owner-id" => ["owner-id"],
1229 "author-id" => ["author-id"],
1230 "causer-id" => ["causer-id"],
1231 "received" => ["received"],
1232 "commented" => ["commented"],
1236 "comment" => "User specific post data",
1238 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1239 "uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1240 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1241 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1242 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1243 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1244 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1245 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1246 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1247 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1248 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
1249 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
1250 "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
1251 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1252 "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1253 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1254 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1255 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1256 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1257 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1258 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1259 "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1260 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1261 "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1262 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1263 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1264 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1265 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1266 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1267 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1270 "PRIMARY" => ["id"],
1271 "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1272 "uri-id" => ["uri-id"],
1273 "parent-uri-id" => ["parent-uri-id"],
1274 "thr-parent-id" => ["thr-parent-id"],
1275 "external-id" => ["external-id"],
1276 "owner-id" => ["owner-id"],
1277 "author-id" => ["author-id"],
1278 "causer-id" => ["causer-id"],
1280 "contact-id" => ["contact-id"],
1281 "event-id" => ["event-id"],
1283 "author-id_uid" => ["author-id", "uid"],
1284 "author-id_received" => ["author-id", "received"],
1285 "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1286 "uid_contactid" => ["uid", "contact-id"],
1287 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1288 "uid_unseen" => ["uid", "unseen"],
1289 "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1292 "post-thread-user" => [
1293 "comment" => "Thread related data per user",
1295 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1296 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1297 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1298 "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
1299 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1300 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1301 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1302 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
1303 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1304 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1305 "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The thread is pinned on the profile page"],
1306 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1307 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1308 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1309 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1310 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1311 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1312 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1313 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1314 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1315 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1316 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1317 "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1320 "PRIMARY" => ["uid", "uri-id"],
1321 "uri-id" => ["uri-id"],
1322 "owner-id" => ["owner-id"],
1323 "author-id" => ["author-id"],
1324 "causer-id" => ["causer-id"],
1326 "contact-id" => ["contact-id"],
1328 "post-user-id" => ["post-user-id"],
1329 "commented" => ["commented"],
1330 "uid_received" => ["uid", "received"],
1331 "uid_wall_received" => ["uid", "wall", "received"],
1332 "uid_pinned" => ["uid", "pinned"],
1333 "uid_commented" => ["uid", "commented"],
1334 "uid_starred" => ["uid", "starred"],
1335 "uid_mention" => ["uid", "mention"],
1338 "post-user-notification" => [
1339 "comment" => "User post notifications",
1341 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1342 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1343 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1346 "PRIMARY" => ["uid", "uri-id"],
1347 "uri-id" => ["uri-id"],
1351 "comment" => "Currently running system processes",
1353 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1354 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1355 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1358 "PRIMARY" => ["pid"],
1359 "command" => ["command"],
1363 "comment" => "user profiles data",
1365 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1366 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1367 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1368 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1369 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1370 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1371 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1372 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1373 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1374 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1375 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1376 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1377 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1378 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1379 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1380 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1381 "with" => ["type" => "text", "comment" => "Deprecated"],
1382 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1383 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1384 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1385 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1386 "pub_keywords" => ["type" => "text", "comment" => ""],
1387 "prv_keywords" => ["type" => "text", "comment" => ""],
1388 "likes" => ["type" => "text", "comment" => "Deprecated"],
1389 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1390 "about" => ["type" => "text", "comment" => "Profile description"],
1391 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1392 "music" => ["type" => "text", "comment" => "Deprecated"],
1393 "book" => ["type" => "text", "comment" => "Deprecated"],
1394 "tv" => ["type" => "text", "comment" => "Deprecated"],
1395 "film" => ["type" => "text", "comment" => "Deprecated"],
1396 "interest" => ["type" => "text", "comment" => "Deprecated"],
1397 "romance" => ["type" => "text", "comment" => "Deprecated"],
1398 "work" => ["type" => "text", "comment" => "Deprecated"],
1399 "education" => ["type" => "text", "comment" => "Deprecated"],
1400 "contact" => ["type" => "text", "comment" => "Deprecated"],
1401 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1402 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1403 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1404 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1405 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1406 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1409 "PRIMARY" => ["id"],
1410 "uid_is-default" => ["uid", "is-default"],
1411 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1414 "profile_check" => [
1415 "comment" => "DFRN remote auth use",
1417 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1418 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1419 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1420 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1421 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1422 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1425 "PRIMARY" => ["id"],
1430 "profile_field" => [
1431 "comment" => "Custom profile fields",
1433 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1434 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1435 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1436 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1437 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1438 "value" => ["type" => "text", "comment" => "Value of the field"],
1439 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1440 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1443 "PRIMARY" => ["id"],
1445 "order" => ["order"],
1449 "push_subscriber" => [
1450 "comment" => "Used for OStatus: Contains feed subscribers",
1452 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1453 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1454 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1455 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1456 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1457 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1458 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1459 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1460 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1461 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1464 "PRIMARY" => ["id"],
1465 "next_try" => ["next_try"],
1470 "comment" => "registrations requiring admin approval",
1472 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1473 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1474 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1475 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1476 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1477 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1478 "note" => ["type" => "text", "comment" => ""],
1481 "PRIMARY" => ["id"],
1488 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1489 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1490 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1493 "PRIMARY" => ["id"],
1494 "uid_term" => ["uid", "term(64)"],
1495 "term" => ["term(64)"]
1499 "comment" => "web session storage",
1501 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1502 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1503 "data" => ["type" => "text", "comment" => ""],
1504 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1507 "PRIMARY" => ["id"],
1508 "sid" => ["sid(64)"],
1509 "expire" => ["expire"],
1513 "comment" => "Data stored by Database storage backend",
1515 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1516 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1523 "comment" => "OAuth usage",
1525 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1526 "secret" => ["type" => "text", "comment" => ""],
1527 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
1528 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1529 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1530 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1533 "PRIMARY" => ["id"],
1534 "client_id" => ["client_id"],
1539 "comment" => "Deleted usernames",
1541 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1542 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1545 "PRIMARY" => ["id"],
1546 "username" => ["username(32)"],
1550 "comment" => "User specific public contact data",
1552 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1553 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1554 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1555 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1556 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1559 "PRIMARY" => ["uid", "cid"],
1564 "comment" => "Inter process communication between the frontend and the worker",
1566 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1567 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1570 "PRIMARY" => ["key"],
1572 "engine" => "MEMORY",
1575 "comment" => "Background tasks queue entries",
1577 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1578 "command" => ["type" => "varchar(100)", "comment" => "Task command"],
1579 "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
1580 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1581 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1582 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1583 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1584 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1585 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1586 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1589 "PRIMARY" => ["id"],
1590 "command" => ["command"],
1591 "done_command_parameter" => ["done", "command", "parameter(64)"],
1592 "done_executed" => ["done", "executed"],
1593 "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
1594 "done_priority_next_try" => ["done", "priority", "next_try"],
1595 "done_pid_next_try" => ["done", "pid", "next_try"],
1596 "done_pid_retrial" => ["done", "pid", "retrial"],
1597 "done_pid_priority_created" => ["done", "pid", "priority", "created"]