3 * @copyright Copyright (C) 2010-2022, 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', 1449);
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"], "comment" => "The parent user that has full control about this user"],
102 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
103 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
104 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
105 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
106 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
107 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
108 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
109 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
110 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
111 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
112 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
113 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
114 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
115 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
116 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
117 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
118 "spubkey" => ["type" => "text", "comment" => ""],
119 "sprvkey" => ["type" => "text", "comment" => ""],
120 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
121 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
122 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
123 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
124 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
125 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
126 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
127 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
128 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
129 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
130 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
131 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
132 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
133 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
134 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
135 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
136 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
137 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
138 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
139 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
140 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
141 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
142 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
143 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
144 "openidserver" => ["type" => "text", "comment" => ""],
147 "PRIMARY" => ["uid"],
148 "nickname" => ["nickname(32)"],
149 "parent-uid" => ["parent-uid"],
151 "email" => ["email(64)"],
155 "comment" => "URI and GUID for items",
157 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
158 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
159 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
163 "uri" => ["UNIQUE", "uri"],
168 "comment" => "contact table",
170 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
171 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
172 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
173 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
174 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
175 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
176 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
177 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
178 "about" => ["type" => "text", "comment" => ""],
179 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
180 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
181 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
182 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
183 "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
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 "notify" => ["type" => "varchar(255)", "comment" => ""],
193 "poll" => ["type" => "varchar(255)", "comment" => ""],
194 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
195 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
196 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
197 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
198 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
199 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
200 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
201 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
202 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
203 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
204 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
205 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Person, organisation, news, community, relay"],
206 "manually-approve" => ["type" => "boolean", "comment" => "Contact requests have to be approved manually"],
207 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
208 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
209 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
210 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
211 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
212 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
213 // User depending fields
214 "reason" => ["type" => "text", "comment" => ""],
215 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
216 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
217 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
218 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
219 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
220 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
221 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Automatically detected feed poll frequency"],
222 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Feed poll priority"],
223 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
224 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
225 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Contact request is pending"],
226 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
227 "info" => ["type" => "mediumtext", "comment" => ""],
228 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
229 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
230 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
231 // Deprecated, but still in use
232 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
233 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
234 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
235 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
236 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
237 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
238 "request" => ["type" => "varchar(255)", "comment" => ""],
239 "confirm" => ["type" => "varchar(255)", "comment" => ""],
240 "poco" => ["type" => "varchar(255)", "comment" => ""],
241 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
242 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead"],
243 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead"],
244 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
245 // Deprecated fields that aren't in use anymore
246 "site-pubkey" => ["type" => "text", "comment" => "Deprecated"],
247 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
248 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
249 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
250 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
251 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
252 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
253 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
254 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => "Deprecated"],
255 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
259 "uid_name" => ["uid", "name(190)"],
260 "self_uid" => ["self", "uid"],
261 "alias_uid" => ["alias(128)", "uid"],
262 "pending_uid" => ["pending", "uid"],
263 "blocked_uid" => ["blocked", "uid"],
264 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
265 "uid_network_batch" => ["uid", "network", "batch(64)"],
266 "batch_contact-type" => ["batch(64)", "contact-type"],
267 "addr_uid" => ["addr(128)", "uid"],
268 "nurl_uid" => ["nurl(128)", "uid"],
269 "nick_uid" => ["nick(128)", "uid"],
270 "attag_uid" => ["attag(96)", "uid"],
271 "network_uid_lastupdate" => ["network", "uid", "last-update"],
272 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
273 "uid_lastitem" => ["uid", "last-item"],
274 "baseurl" => ["baseurl(64)"],
275 "uid_contact-type" => ["uid", "contact-type"],
276 "uid_self_contact-type" => ["uid", "self", "contact-type"],
277 "self_network_uid" => ["self", "network", "uid"],
279 "uri-id" => ["uri-id"],
283 "comment" => "tags and mentions",
285 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
286 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
287 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
291 "type_name_url" => ["UNIQUE", "name", "url"],
298 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
299 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
300 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
301 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
302 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
303 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
307 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
311 "comment" => "Activity Verbs",
313 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
314 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
322 "2fa_app_specific_password" => [
323 "comment" => "Two-factor app-specific _password",
325 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
326 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
327 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
328 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
329 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
330 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
334 "uid_description" => ["uid", "description(190)"],
337 "2fa_recovery_codes" => [
338 "comment" => "Two-factor authentication recovery codes",
340 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
341 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
342 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
343 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
346 "PRIMARY" => ["uid", "code"]
349 "2fa_trusted_browser" => [
350 "comment" => "Two-factor authentication trusted browsers",
352 "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
353 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
354 "user_agent" => ["type" => "text", "comment" => "User agent string"],
355 "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
356 "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
359 "PRIMARY" => ["cookie_hash"],
364 "comment" => "registered addons",
366 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
367 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
368 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
369 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
370 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
371 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
372 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
376 "installed_name" => ["installed", "name"],
377 "name" => ["UNIQUE", "name"],
381 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
383 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
384 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
385 "uuid" => ["type" => "varchar(255)", "comment" => ""],
386 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
387 "following" => ["type" => "varchar(255)", "comment" => ""],
388 "followers" => ["type" => "varchar(255)", "comment" => ""],
389 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
390 "outbox" => ["type" => "varchar(255)", "comment" => ""],
391 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
392 "manually-approve" => ["type" => "boolean", "comment" => ""],
393 "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
394 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
395 "name" => ["type" => "varchar(255)", "comment" => ""],
396 "about" => ["type" => "text", "comment" => ""],
397 "xmpp" => ["type" => "varchar(255)", "comment" => "XMPP address"],
398 "matrix" => ["type" => "varchar(255)", "comment" => "Matrix address"],
399 "photo" => ["type" => "varchar(255)", "comment" => ""],
400 "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
401 "addr" => ["type" => "varchar(255)", "comment" => ""],
402 "alias" => ["type" => "varchar(255)", "comment" => ""],
403 "pubkey" => ["type" => "text", "comment" => ""],
404 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
405 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
406 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
407 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
408 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
409 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
410 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
411 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
414 "PRIMARY" => ["url"],
415 "addr" => ["addr(32)"],
416 "alias" => ["alias(190)"],
417 "followers" => ["followers(190)"],
418 "baseurl" => ["baseurl(190)"],
419 "sharedinbox" => ["sharedinbox(190)"],
421 "uri-id" => ["UNIQUE", "uri-id"],
425 "comment" => "OAuth application",
427 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
428 "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
429 "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
430 "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
431 "redirect_uri" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
432 "website" => ["type" => "varchar(255)", "comment" => ""],
433 "scopes" => ["type" => "varchar(255)", "comment" => ""],
434 "read" => ["type" => "boolean", "comment" => "Read scope"],
435 "write" => ["type" => "boolean", "comment" => "Write scope"],
436 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
437 "push" => ["type" => "boolean", "comment" => "Push scope"],
441 "client_id" => ["UNIQUE", "client_id"]
444 "application-token" => [
445 "comment" => "OAuth user token",
447 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
448 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
449 "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
450 "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
451 "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
452 "scopes" => ["type" => "varchar(255)", "comment" => ""],
453 "read" => ["type" => "boolean", "comment" => "Read scope"],
454 "write" => ["type" => "boolean", "comment" => "Write scope"],
455 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
456 "push" => ["type" => "boolean", "comment" => "Push scope"],
459 "PRIMARY" => ["application-id", "uid"],
460 "uid_id" => ["uid", "application-id"],
464 "comment" => "file attachments",
466 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
467 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
468 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
469 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
470 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
471 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
472 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
473 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
474 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
475 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
476 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
477 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
478 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
479 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
480 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
488 "comment" => "Stores temporary data",
490 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
491 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
492 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
493 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
497 "k_expires" => ["k", "expires"],
501 "comment" => "main configuration storage",
503 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
504 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
505 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
506 "v" => ["type" => "mediumtext", "comment" => ""],
510 "cat_k" => ["UNIQUE", "cat", "k"],
513 "contact-relation" => [
514 "comment" => "Contact relations",
516 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
517 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
518 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
519 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
520 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
523 "PRIMARY" => ["cid", "relation-cid"],
524 "relation-cid" => ["relation-cid"],
528 "comment" => "private messages",
530 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
531 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
532 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
533 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
534 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
535 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
536 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
537 "subject" => ["type" => "text", "comment" => "subject of initial message"],
545 "comment" => "Raw data and structure information for messages",
547 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
548 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
549 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
550 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
551 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
552 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
553 "source" => ["type" => "mediumtext", "comment" => "Original source"],
554 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
557 "PRIMARY" => ["item-uri"],
558 "conversation-uri" => ["conversation-uri"],
559 "received" => ["received"],
563 "comment" => "Background tasks queue entries",
565 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
566 "command" => ["type" => "varchar(100)", "comment" => "Task command"],
567 "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
568 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
569 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
570 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
571 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
572 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
573 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
574 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
578 "command" => ["command"],
579 "done_command_parameter" => ["done", "command", "parameter(64)"],
580 "done_executed" => ["done", "executed"],
581 "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
582 "done_priority_next_try" => ["done", "priority", "next_try"],
583 "done_pid_next_try" => ["done", "pid", "next_try"],
584 "done_pid_retrial" => ["done", "pid", "retrial"],
585 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
589 "comment" => "Posts that are about to be distributed at a later time",
591 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
592 "uri" => ["type" => "varchar(255)", "comment" => "URI of the post that will be distributed later"],
593 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
594 "delayed" => ["type" => "datetime", "comment" => "delay time"],
595 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
599 "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
603 "diaspora-interaction" => [
604 "comment" => "Signed Diaspora Interaction",
606 "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"],
607 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
610 "PRIMARY" => ["uri-id"]
614 "comment" => "Events",
616 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
617 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
618 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
619 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
620 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
621 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
622 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
623 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
624 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
625 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
626 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
627 "desc" => ["type" => "text", "comment" => "event description"],
628 "location" => ["type" => "text", "comment" => "event location"],
629 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
630 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
631 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
632 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
633 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
634 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
635 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
639 "uid_start" => ["uid", "start"],
641 "uri-id" => ["uri-id"],
645 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
647 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
648 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
649 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
650 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the fcontact url"],
651 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
652 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
653 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
654 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
655 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
656 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
657 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
658 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
659 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
660 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
661 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
662 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
663 "pubkey" => ["type" => "text", "comment" => ""],
664 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
665 "interacting_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts this contact interactes with"],
666 "interacted_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts that interacted with this contact"],
667 "post_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts and comments"],
671 "addr" => ["addr(32)"],
672 "url" => ["UNIQUE", "url(190)"],
673 "uri-id" => ["UNIQUE", "uri-id"],
677 "comment" => "friend suggestion stuff",
679 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
680 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
681 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
682 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
683 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
684 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
685 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
686 "note" => ["type" => "text", "comment" => ""],
687 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
696 "comment" => "privacy groups, group info",
698 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
699 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
700 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
701 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
702 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
710 "comment" => "privacy groups, member info",
712 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
713 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
714 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
718 "contactid" => ["contact-id"],
719 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
723 "comment" => "Tags that the server has subscribed",
725 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
726 "comment" => "The id of the gserver"],
727 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
730 "PRIMARY" => ["gserver-id", "tag"],
735 "comment" => "addon hook registry",
737 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
738 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
739 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
740 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
741 "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"],
745 "priority" => ["priority"],
746 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
750 "comment" => "Status of ActivityPub inboxes",
752 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
753 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
754 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
755 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
756 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
757 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
758 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
767 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
768 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
769 "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => "deprecated"],
770 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
771 "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
772 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
773 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
774 "note" => ["type" => "text", "comment" => ""],
775 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
776 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
777 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
778 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
782 "contact-id" => ["contact-id"],
783 "suggest-cid" => ["suggest-cid"],
790 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
791 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
792 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
793 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
794 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
798 "name_expires" => ["name", "expires"]
802 "comment" => "private messages",
804 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
805 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
806 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
807 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
808 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
809 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
810 "contact-id" => ["type" => "varchar(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
811 "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"],
812 "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
813 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
814 "body" => ["type" => "mediumtext", "comment" => ""],
815 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
816 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
817 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
818 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
819 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
820 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
821 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
822 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
823 "thr-parent" => ["type" => "varchar(255)", "comment" => ""],
824 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
825 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
829 "uid_seen" => ["uid", "seen"],
830 "convid" => ["convid"],
831 "uri" => ["uri(64)"],
832 "parent-uri" => ["parent-uri(64)"],
833 "contactid" => ["contact-id(32)"],
834 "author-id" => ["author-id"],
835 "uri-id" => ["uri-id"],
836 "parent-uri-id" => ["parent-uri-id"],
837 "thr-parent-id" => ["thr-parent-id"],
841 "comment" => "Mail account data for fetching mails",
843 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
844 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
845 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
846 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
847 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
848 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
849 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
850 "pass" => ["type" => "text", "comment" => ""],
851 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
852 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
853 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
854 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
855 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
863 "comment" => "table of accounts that can manage each other",
865 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
866 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
867 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
871 "uid_mid" => ["UNIQUE", "uid", "mid"],
876 "comment" => "notifications",
878 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
879 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
880 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
881 "type" => ["type" => "tinyint unsigned", "comment" => ""],
882 "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
883 "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
884 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
885 "created" => ["type" => "datetime", "comment" => ""],
886 "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
887 "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
891 "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
893 "actor-id" => ["actor-id"],
894 "target-uri-id" => ["target-uri-id"],
895 "parent-uri-id" => ["parent-uri-id"],
896 "seen_uid" => ["seen", "uid"],
900 "comment" => "notifications",
902 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
903 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
904 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
905 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
906 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
907 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
908 "msg" => ["type" => "mediumtext", "comment" => ""],
909 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
910 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
911 "iid" => ["type" => "int unsigned", "comment" => ""],
912 "parent" => ["type" => "int unsigned", "comment" => ""],
913 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
914 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
915 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
916 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
917 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
918 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
919 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
923 "seen_uid_date" => ["seen", "uid", "date"],
924 "uid_date" => ["uid", "date"],
925 "uid_type_link" => ["uid", "type", "link(190)"],
926 "uri-id" => ["uri-id"],
927 "parent-uri-id" => ["parent-uri-id"],
930 "notify-threads" => [
933 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
934 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
935 "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
936 "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
937 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
938 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
939 "comment" => "User id"],
943 "master-parent-uri-id" => ["master-parent-uri-id"],
944 "receiver-uid" => ["receiver-uid"],
945 "notify-id" => ["notify-id"],
949 "comment" => "cache for OEmbed queries",
951 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
952 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
953 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
954 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
957 "PRIMARY" => ["url", "maxwidth"],
958 "created" => ["created"],
961 "openwebauth-token" => [
962 "comment" => "Store OpenWebAuth token to verify contacts",
964 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
965 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
966 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
967 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
968 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
969 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
977 "comment" => "cache for 'parse_url' queries",
979 "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
980 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
981 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
982 "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
983 "content" => ["type" => "mediumtext", "comment" => "page data"],
984 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
985 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
988 "PRIMARY" => ["url_hash", "guessing", "oembed"],
989 "created" => ["created"],
990 "expires" => ["expires"],
994 "comment" => "personal (per user) configuration storage",
996 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
997 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
998 "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
999 "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1000 "v" => ["type" => "mediumtext", "comment" => "Value"],
1003 "PRIMARY" => ["id"],
1004 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1008 "comment" => "photo storage",
1010 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1011 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1012 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1013 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1014 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1015 "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1016 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1017 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1018 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1019 "desc" => ["type" => "text", "comment" => ""],
1020 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1021 "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
1022 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1023 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1024 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1025 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1026 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1027 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1028 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1029 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1030 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1031 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1032 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1033 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1034 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1035 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1036 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1037 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1040 "PRIMARY" => ["id"],
1041 "contactid" => ["contact-id"],
1042 "uid_contactid" => ["uid", "contact-id"],
1043 "uid_profile" => ["uid", "profile"],
1044 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1045 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1046 "resource-id" => ["resource-id"],
1047 "uid_photo-type" => ["uid", "photo-type"],
1051 "comment" => "Structure for all posts",
1053 "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"],
1054 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1055 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1056 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1057 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1058 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1059 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1060 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1061 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1062 "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"],
1063 "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"],
1064 "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"],
1065 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1066 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1067 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1068 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1069 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1070 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1073 "PRIMARY" => ["uri-id"],
1074 "parent-uri-id" => ["parent-uri-id"],
1075 "thr-parent-id" => ["thr-parent-id"],
1076 "external-id" => ["external-id"],
1077 "owner-id" => ["owner-id"],
1078 "author-id" => ["author-id"],
1079 "causer-id" => ["causer-id"],
1083 "post-category" => [
1084 "comment" => "post relation to categories",
1086 "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"],
1087 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1088 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1089 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1092 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1093 "uri-id" => ["tid"],
1098 "comment" => "Content for all posts",
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 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1102 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1103 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1104 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1105 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1106 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1107 "language" => ["type" => "text", "comment" => "Language information about this post"],
1108 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1109 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1110 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1111 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1112 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1113 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1114 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1115 "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"],
1116 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1119 "PRIMARY" => ["uri-id"],
1120 "plink" => ["plink(191)"],
1121 "resource-id" => ["resource-id"],
1122 "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1125 "post-delivery-data" => [
1126 "comment" => "Delivery data for items",
1128 "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"],
1129 "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"],
1130 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1131 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1132 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1133 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1134 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1135 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1136 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1137 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1138 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1141 "PRIMARY" => ["uri-id"],
1145 "comment" => "Post related external links",
1147 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1148 "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"],
1149 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
1150 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1153 "PRIMARY" => ["id"],
1154 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1158 "comment" => "Attached media",
1160 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1161 "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"],
1162 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "Media URL"],
1163 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1164 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1165 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1166 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1167 "size" => ["type" => "int unsigned", "comment" => "Media size"],
1168 "preview" => ["type" => "varbinary(255)", "comment" => "Preview URL"],
1169 "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1170 "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1171 "description" => ["type" => "text", "comment" => ""],
1172 "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1173 "author-url" => ["type" => "varbinary(255)", "comment" => "URL of the author of the media"],
1174 "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1175 "author-image" => ["type" => "varbinary(255)", "comment" => "Image of the author of the media"],
1176 "publisher-url" => ["type" => "varbinary(255)", "comment" => "URL of the publisher of the media"],
1177 "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1178 "publisher-image" => ["type" => "varbinary(255)", "comment" => "Image of the publisher of the media"],
1181 "PRIMARY" => ["id"],
1182 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1186 "comment" => "post relation to tags",
1188 "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"],
1189 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1190 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1191 "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"],
1194 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1200 "comment" => "Thread related data",
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 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1204 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1205 "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"],
1206 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1207 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1208 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1209 "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"],
1210 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1213 "PRIMARY" => ["uri-id"],
1214 "owner-id" => ["owner-id"],
1215 "author-id" => ["author-id"],
1216 "causer-id" => ["causer-id"],
1217 "received" => ["received"],
1218 "commented" => ["commented"],
1222 "comment" => "User specific post data",
1224 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1225 "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"],
1226 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1227 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1228 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1229 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1230 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1231 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1232 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1233 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1234 "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"],
1235 "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"],
1236 "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"],
1237 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1238 "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1239 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1240 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1241 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1242 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1243 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1244 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1245 "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1246 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1247 "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1248 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1249 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1250 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1251 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1252 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1253 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1256 "PRIMARY" => ["id"],
1257 "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1258 "uri-id" => ["uri-id"],
1259 "parent-uri-id" => ["parent-uri-id"],
1260 "thr-parent-id" => ["thr-parent-id"],
1261 "external-id" => ["external-id"],
1262 "owner-id" => ["owner-id"],
1263 "author-id" => ["author-id"],
1264 "causer-id" => ["causer-id"],
1266 "contact-id" => ["contact-id"],
1267 "event-id" => ["event-id"],
1269 "author-id_uid" => ["author-id", "uid"],
1270 "author-id_received" => ["author-id", "received"],
1271 "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1272 "uid_contactid" => ["uid", "contact-id"],
1273 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1274 "uid_unseen" => ["uid", "unseen"],
1275 "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1278 "post-thread-user" => [
1279 "comment" => "Thread related data per user",
1281 "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"],
1282 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1283 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1284 "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"],
1285 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1286 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1287 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1288 "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"],
1289 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1290 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1291 "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The thread is pinned on the profile page"],
1292 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1293 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1294 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1295 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1296 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1297 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1298 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1299 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1300 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1301 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1302 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1303 "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1306 "PRIMARY" => ["uid", "uri-id"],
1307 "uri-id" => ["uri-id"],
1308 "owner-id" => ["owner-id"],
1309 "author-id" => ["author-id"],
1310 "causer-id" => ["causer-id"],
1312 "contact-id" => ["contact-id"],
1314 "post-user-id" => ["post-user-id"],
1315 "commented" => ["commented"],
1316 "uid_received" => ["uid", "received"],
1317 "uid_wall_received" => ["uid", "wall", "received"],
1318 "uid_pinned" => ["uid", "pinned"],
1319 "uid_commented" => ["uid", "commented"],
1320 "uid_starred" => ["uid", "starred"],
1321 "uid_mention" => ["uid", "mention"],
1324 "post-user-notification" => [
1325 "comment" => "User post notifications",
1327 "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"],
1328 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1329 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1332 "PRIMARY" => ["uid", "uri-id"],
1333 "uri-id" => ["uri-id"],
1337 "comment" => "Currently running system processes",
1339 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1340 "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
1341 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1342 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1345 "PRIMARY" => ["pid", "hostname"],
1346 "command" => ["command"],
1350 "comment" => "user profiles data",
1352 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1353 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1354 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1355 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1356 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1357 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1358 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1359 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1360 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1361 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1362 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1363 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1364 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1365 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1366 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1367 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1368 "with" => ["type" => "text", "comment" => "Deprecated"],
1369 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1370 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1371 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1372 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1373 "pub_keywords" => ["type" => "text", "comment" => ""],
1374 "prv_keywords" => ["type" => "text", "comment" => ""],
1375 "likes" => ["type" => "text", "comment" => "Deprecated"],
1376 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1377 "about" => ["type" => "text", "comment" => "Profile description"],
1378 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1379 "music" => ["type" => "text", "comment" => "Deprecated"],
1380 "book" => ["type" => "text", "comment" => "Deprecated"],
1381 "tv" => ["type" => "text", "comment" => "Deprecated"],
1382 "film" => ["type" => "text", "comment" => "Deprecated"],
1383 "interest" => ["type" => "text", "comment" => "Deprecated"],
1384 "romance" => ["type" => "text", "comment" => "Deprecated"],
1385 "work" => ["type" => "text", "comment" => "Deprecated"],
1386 "education" => ["type" => "text", "comment" => "Deprecated"],
1387 "contact" => ["type" => "text", "comment" => "Deprecated"],
1388 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1389 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
1390 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
1391 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1392 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1393 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1394 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1397 "PRIMARY" => ["id"],
1398 "uid_is-default" => ["uid", "is-default"],
1399 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1402 "profile_field" => [
1403 "comment" => "Custom profile fields",
1405 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1406 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1407 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1408 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1409 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1410 "value" => ["type" => "text", "comment" => "Value of the field"],
1411 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1412 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1415 "PRIMARY" => ["id"],
1417 "order" => ["order"],
1421 "push_subscriber" => [
1422 "comment" => "Used for OStatus: Contains feed subscribers",
1424 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1425 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1426 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1427 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1428 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1429 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1430 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1431 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1432 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1433 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1436 "PRIMARY" => ["id"],
1437 "next_try" => ["next_try"],
1442 "comment" => "registrations requiring admin approval",
1444 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1445 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1446 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1447 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1448 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1449 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1450 "note" => ["type" => "text", "comment" => ""],
1453 "PRIMARY" => ["id"],
1460 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1461 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1462 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1465 "PRIMARY" => ["id"],
1466 "uid_term" => ["uid", "term(64)"],
1467 "term" => ["term(64)"]
1471 "comment" => "web session storage",
1473 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1474 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1475 "data" => ["type" => "text", "comment" => ""],
1476 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1479 "PRIMARY" => ["id"],
1480 "sid" => ["sid(64)"],
1481 "expire" => ["expire"],
1485 "comment" => "Data stored by Database storage backend",
1487 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1488 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1495 "comment" => "Push Subscription for the API",
1497 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1498 "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""],
1499 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1500 "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"],
1501 "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"],
1502 "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"],
1503 "follow" => ["type" => "boolean", "comment" => ""],
1504 "favourite" => ["type" => "boolean", "comment" => ""],
1505 "reblog" => ["type" => "boolean", "comment" => ""],
1506 "mention" => ["type" => "boolean", "comment" => ""],
1507 "poll" => ["type" => "boolean", "comment" => ""],
1508 "follow_request" => ["type" => "boolean", "comment" => ""],
1509 "status" => ["type" => "boolean", "comment" => ""],
1512 "PRIMARY" => ["id"],
1513 "application-id_uid" => ["UNIQUE", "application-id", "uid"],
1514 "uid_application-id" => ["uid", "application-id"],
1518 "comment" => "Deleted usernames",
1520 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1521 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1524 "PRIMARY" => ["id"],
1525 "username" => ["username(32)"],
1529 "comment" => "User specific public contact data",
1531 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1532 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1533 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
1534 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1535 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1536 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
1537 "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
1538 "pending" => ["type" => "boolean", "comment" => ""],
1539 "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
1540 "info" => ["type" => "mediumtext", "comment" => ""],
1541 "notify_new_posts" => ["type" => "boolean", "comment" => ""],
1542 "remote_self" => ["type" => "boolean", "comment" => ""],
1543 "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => ""],
1544 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
1545 "subhub" => ["type" => "boolean", "comment" => ""],
1546 "hub-verify" => ["type" => "varchar(255)", "comment" => ""],
1547 "protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
1548 "rating" => ["type" => "tinyint", "comment" => "Automatically detected feed poll frequency"],
1549 "priority" => ["type" => "tinyint unsigned", "comment" => "Feed poll priority"],
1552 "PRIMARY" => ["uid", "cid"],
1554 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
1558 "comment" => "Inter process communication between the frontend and the worker",
1560 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1561 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1564 "PRIMARY" => ["key"],
1566 "engine" => "MEMORY",