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', 1453);
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 "active-week-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last week"],
75 "active-month-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last month"],
76 "active-halfyear-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last six month"],
77 "local-posts" => ["type" => "int unsigned", "comment" => "Number of local posts"],
78 "local-comments" => ["type" => "int unsigned", "comment" => "Number of local comments"],
79 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
80 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
81 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
82 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
83 "protocol" => ["type" => "tinyint unsigned", "comment" => "The protocol of the server"],
84 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
85 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
86 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
87 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
88 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
89 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
90 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last successful connection request"],
91 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last failed connection request"],
92 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
93 "next_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Next connection request"],
97 "nurl" => ["UNIQUE", "nurl(190)"],
98 "next_contact" => ["next_contact"],
99 "network" => ["network"],
103 "comment" => "The local users",
105 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
106 "parent-uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "The parent user that has full control about this user"],
107 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
108 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
109 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
110 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
111 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
112 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
113 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
114 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
115 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
116 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
117 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
118 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
119 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
120 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
121 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
122 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
123 "spubkey" => ["type" => "text", "comment" => ""],
124 "sprvkey" => ["type" => "text", "comment" => ""],
125 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
126 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
127 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
128 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
129 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
130 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
131 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
132 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
133 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
134 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
135 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
136 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
137 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
138 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
139 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
140 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
141 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
142 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
143 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
144 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
145 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
146 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
147 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
148 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
149 "openidserver" => ["type" => "text", "comment" => ""],
152 "PRIMARY" => ["uid"],
153 "nickname" => ["nickname(32)"],
154 "parent-uid" => ["parent-uid"],
156 "email" => ["email(64)"],
160 "comment" => "URI and GUID for items",
162 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
163 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
164 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
168 "uri" => ["UNIQUE", "uri"],
173 "comment" => "contact table",
175 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
176 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
177 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
178 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
179 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
180 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
181 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
182 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
183 "about" => ["type" => "text", "comment" => ""],
184 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
185 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
186 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
187 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
188 "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
189 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
190 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
191 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
192 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
193 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
194 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
195 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
196 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
197 "notify" => ["type" => "varchar(255)", "comment" => ""],
198 "poll" => ["type" => "varchar(255)", "comment" => ""],
199 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
200 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
201 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
202 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
203 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
204 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
205 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
206 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
207 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
208 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
209 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
210 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Person, organisation, news, community, relay"],
211 "manually-approve" => ["type" => "boolean", "comment" => "Contact requests have to be approved manually"],
212 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
213 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
214 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
215 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
216 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
217 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
218 // User depending fields
219 "reason" => ["type" => "text", "comment" => ""],
220 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
221 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
222 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
223 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
224 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
225 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
226 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Automatically detected feed poll frequency"],
227 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Feed poll priority"],
228 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
229 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
230 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Contact request is pending"],
231 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
232 "info" => ["type" => "mediumtext", "comment" => ""],
233 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
234 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
235 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
236 // Deprecated, but still in use
237 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
238 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
239 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
240 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
241 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
242 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
243 "request" => ["type" => "varchar(255)", "comment" => ""],
244 "confirm" => ["type" => "varchar(255)", "comment" => ""],
245 "poco" => ["type" => "varchar(255)", "comment" => ""],
246 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
247 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead"],
248 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead"],
249 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
250 // Deprecated fields that aren't in use anymore
251 "site-pubkey" => ["type" => "text", "comment" => "Deprecated"],
252 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
253 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
254 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
255 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
256 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
257 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
258 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
259 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => "Deprecated"],
260 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
264 "uid_name" => ["uid", "name(190)"],
265 "self_uid" => ["self", "uid"],
266 "alias_uid" => ["alias(128)", "uid"],
267 "pending_uid" => ["pending", "uid"],
268 "blocked_uid" => ["blocked", "uid"],
269 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
270 "uid_network_batch" => ["uid", "network", "batch(64)"],
271 "batch_contact-type" => ["batch(64)", "contact-type"],
272 "addr_uid" => ["addr(128)", "uid"],
273 "nurl_uid" => ["nurl(128)", "uid"],
274 "nick_uid" => ["nick(128)", "uid"],
275 "attag_uid" => ["attag(96)", "uid"],
276 "network_uid_lastupdate" => ["network", "uid", "last-update"],
277 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
278 "uid_lastitem" => ["uid", "last-item"],
279 "baseurl" => ["baseurl(64)"],
280 "uid_contact-type" => ["uid", "contact-type"],
281 "uid_self_contact-type" => ["uid", "self", "contact-type"],
282 "self_network_uid" => ["self", "network", "uid"],
284 "uri-id" => ["uri-id"],
288 "comment" => "tags and mentions",
290 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
291 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
292 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
296 "type_name_url" => ["UNIQUE", "name", "url"],
303 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
304 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
305 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
306 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
307 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
308 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
312 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
316 "comment" => "Activity Verbs",
318 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
319 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
327 "2fa_app_specific_password" => [
328 "comment" => "Two-factor app-specific _password",
330 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
331 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
332 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
333 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
334 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
335 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
339 "uid_description" => ["uid", "description(190)"],
342 "2fa_recovery_codes" => [
343 "comment" => "Two-factor authentication recovery codes",
345 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
346 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
347 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
348 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
351 "PRIMARY" => ["uid", "code"]
354 "2fa_trusted_browser" => [
355 "comment" => "Two-factor authentication trusted browsers",
357 "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
358 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
359 "user_agent" => ["type" => "text", "comment" => "User agent string"],
360 "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
361 "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
364 "PRIMARY" => ["cookie_hash"],
369 "comment" => "registered addons",
371 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
372 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
373 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
374 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
375 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
376 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
377 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
381 "installed_name" => ["installed", "name"],
382 "name" => ["UNIQUE", "name"],
386 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
388 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
389 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
390 "uuid" => ["type" => "varchar(255)", "comment" => ""],
391 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
392 "following" => ["type" => "varchar(255)", "comment" => ""],
393 "followers" => ["type" => "varchar(255)", "comment" => ""],
394 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
395 "outbox" => ["type" => "varchar(255)", "comment" => ""],
396 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
397 "manually-approve" => ["type" => "boolean", "comment" => ""],
398 "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
399 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
400 "name" => ["type" => "varchar(255)", "comment" => ""],
401 "about" => ["type" => "text", "comment" => ""],
402 "xmpp" => ["type" => "varchar(255)", "comment" => "XMPP address"],
403 "matrix" => ["type" => "varchar(255)", "comment" => "Matrix address"],
404 "photo" => ["type" => "varchar(255)", "comment" => ""],
405 "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
406 "addr" => ["type" => "varchar(255)", "comment" => ""],
407 "alias" => ["type" => "varchar(255)", "comment" => ""],
408 "pubkey" => ["type" => "text", "comment" => ""],
409 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
410 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
411 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
412 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
413 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
414 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
415 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
416 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
419 "PRIMARY" => ["url"],
420 "addr" => ["addr(32)"],
421 "alias" => ["alias(190)"],
422 "followers" => ["followers(190)"],
423 "baseurl" => ["baseurl(190)"],
424 "sharedinbox" => ["sharedinbox(190)"],
426 "uri-id" => ["UNIQUE", "uri-id"],
430 "comment" => "OAuth application",
432 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
433 "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
434 "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
435 "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
436 "redirect_uri" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
437 "website" => ["type" => "varchar(255)", "comment" => ""],
438 "scopes" => ["type" => "varchar(255)", "comment" => ""],
439 "read" => ["type" => "boolean", "comment" => "Read scope"],
440 "write" => ["type" => "boolean", "comment" => "Write scope"],
441 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
442 "push" => ["type" => "boolean", "comment" => "Push scope"],
446 "client_id" => ["UNIQUE", "client_id"]
449 "application-token" => [
450 "comment" => "OAuth user token",
452 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
453 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
454 "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
455 "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
456 "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
457 "scopes" => ["type" => "varchar(255)", "comment" => ""],
458 "read" => ["type" => "boolean", "comment" => "Read scope"],
459 "write" => ["type" => "boolean", "comment" => "Write scope"],
460 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
461 "push" => ["type" => "boolean", "comment" => "Push scope"],
464 "PRIMARY" => ["application-id", "uid"],
465 "uid_id" => ["uid", "application-id"],
469 "comment" => "file attachments",
471 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
472 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
473 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
474 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
475 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
476 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
477 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
478 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
479 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
480 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
481 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
482 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
483 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
484 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
485 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
493 "comment" => "Stores temporary data",
495 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
496 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
497 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
498 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
502 "k_expires" => ["k", "expires"],
506 "comment" => "main configuration storage",
508 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
509 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
510 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
511 "v" => ["type" => "mediumtext", "comment" => ""],
515 "cat_k" => ["UNIQUE", "cat", "k"],
518 "contact-relation" => [
519 "comment" => "Contact relations",
521 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
522 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
523 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
524 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
525 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
528 "PRIMARY" => ["cid", "relation-cid"],
529 "relation-cid" => ["relation-cid"],
533 "comment" => "private messages",
535 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
536 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
537 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
538 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
539 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
540 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
541 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
542 "subject" => ["type" => "text", "comment" => "subject of initial message"],
550 "comment" => "Raw data and structure information for messages",
552 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
553 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
554 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
555 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
556 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
557 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
558 "source" => ["type" => "mediumtext", "comment" => "Original source"],
559 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
562 "PRIMARY" => ["item-uri"],
563 "conversation-uri" => ["conversation-uri"],
564 "received" => ["received"],
568 "comment" => "Background tasks queue entries",
570 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
571 "command" => ["type" => "varchar(100)", "comment" => "Task command"],
572 "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
573 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
574 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
575 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
576 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
577 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
578 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
579 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
583 "command" => ["command"],
584 "done_command_parameter" => ["done", "command", "parameter(64)"],
585 "done_executed" => ["done", "executed"],
586 "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
587 "done_priority_next_try" => ["done", "priority", "next_try"],
588 "done_pid_next_try" => ["done", "pid", "next_try"],
589 "done_pid_retrial" => ["done", "pid", "retrial"],
590 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
594 "comment" => "Posts that are about to be distributed at a later time",
596 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
597 "uri" => ["type" => "varchar(255)", "comment" => "URI of the post that will be distributed later"],
598 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
599 "delayed" => ["type" => "datetime", "comment" => "delay time"],
600 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
604 "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
608 "diaspora-interaction" => [
609 "comment" => "Signed Diaspora Interaction",
611 "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"],
612 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
615 "PRIMARY" => ["uri-id"]
619 "comment" => "Events",
621 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
622 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
623 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
624 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
625 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
626 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
627 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
628 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
629 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
630 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
631 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
632 "desc" => ["type" => "text", "comment" => "event description"],
633 "location" => ["type" => "text", "comment" => "event location"],
634 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
635 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
636 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
637 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
638 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
639 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
640 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
644 "uid_start" => ["uid", "start"],
646 "uri-id" => ["uri-id"],
650 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
652 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
653 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
654 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
655 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the fcontact url"],
656 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
657 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
658 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
659 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
660 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
661 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
662 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
663 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
664 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
665 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
666 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
667 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
668 "pubkey" => ["type" => "text", "comment" => ""],
669 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
670 "interacting_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts this contact interactes with"],
671 "interacted_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts that interacted with this contact"],
672 "post_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts and comments"],
676 "addr" => ["addr(32)"],
677 "url" => ["UNIQUE", "url(190)"],
678 "uri-id" => ["UNIQUE", "uri-id"],
682 "comment" => "friend suggestion stuff",
684 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
685 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
686 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
687 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
688 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
689 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
690 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
691 "note" => ["type" => "text", "comment" => ""],
692 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
701 "comment" => "privacy groups, group info",
703 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
704 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
705 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
706 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
707 "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."],
708 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
717 "comment" => "privacy groups, member info",
719 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
720 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
721 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
725 "contactid" => ["contact-id"],
726 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
730 "comment" => "Tags that the server has subscribed",
732 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
733 "comment" => "The id of the gserver"],
734 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
737 "PRIMARY" => ["gserver-id", "tag"],
742 "comment" => "addon hook registry",
744 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
745 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
746 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
747 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
748 "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"],
752 "priority" => ["priority"],
753 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
757 "comment" => "Status of ActivityPub inboxes",
759 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
760 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
761 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
762 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
763 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
764 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
765 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
774 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
775 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
776 "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => "deprecated"],
777 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
778 "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
779 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
780 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
781 "note" => ["type" => "text", "comment" => ""],
782 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
783 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
784 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
785 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
789 "contact-id" => ["contact-id"],
790 "suggest-cid" => ["suggest-cid"],
797 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
798 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
799 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
800 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
801 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
805 "name_expires" => ["name", "expires"]
809 "comment" => "private messages",
811 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
812 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
813 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
814 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
815 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
816 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
817 "contact-id" => ["type" => "varchar(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
818 "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"],
819 "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
820 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
821 "body" => ["type" => "mediumtext", "comment" => ""],
822 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
823 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
824 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
825 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
826 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
827 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
828 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
829 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
830 "thr-parent" => ["type" => "varchar(255)", "comment" => ""],
831 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
832 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
836 "uid_seen" => ["uid", "seen"],
837 "convid" => ["convid"],
838 "uri" => ["uri(64)"],
839 "parent-uri" => ["parent-uri(64)"],
840 "contactid" => ["contact-id(32)"],
841 "author-id" => ["author-id"],
842 "uri-id" => ["uri-id"],
843 "parent-uri-id" => ["parent-uri-id"],
844 "thr-parent-id" => ["thr-parent-id"],
848 "comment" => "Mail account data for fetching mails",
850 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
851 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
852 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
853 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
854 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
855 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
856 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
857 "pass" => ["type" => "text", "comment" => ""],
858 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
859 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
860 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
861 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
862 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
870 "comment" => "table of accounts that can manage each other",
872 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
873 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
874 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
878 "uid_mid" => ["UNIQUE", "uid", "mid"],
883 "comment" => "notifications",
885 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
886 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
887 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
888 "type" => ["type" => "tinyint unsigned", "comment" => ""],
889 "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
890 "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
891 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
892 "created" => ["type" => "datetime", "comment" => ""],
893 "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
894 "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
898 "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
900 "actor-id" => ["actor-id"],
901 "target-uri-id" => ["target-uri-id"],
902 "parent-uri-id" => ["parent-uri-id"],
903 "seen_uid" => ["seen", "uid"],
907 "comment" => "[Deprecated] User notifications",
909 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
910 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
911 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
912 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
913 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
914 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
915 "msg" => ["type" => "mediumtext", "comment" => ""],
916 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
917 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
918 "iid" => ["type" => "int unsigned", "comment" => ""],
919 "parent" => ["type" => "int unsigned", "comment" => ""],
920 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
921 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
922 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
923 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
924 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
925 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
926 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
930 "seen_uid_date" => ["seen", "uid", "date"],
931 "uid_date" => ["uid", "date"],
932 "uid_type_link" => ["uid", "type", "link(190)"],
933 "uri-id" => ["uri-id"],
934 "parent-uri-id" => ["parent-uri-id"],
937 "notify-threads" => [
940 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
941 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
942 "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
943 "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
944 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
945 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
946 "comment" => "User id"],
950 "master-parent-uri-id" => ["master-parent-uri-id"],
951 "receiver-uid" => ["receiver-uid"],
952 "notify-id" => ["notify-id"],
956 "comment" => "cache for OEmbed queries",
958 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
959 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
960 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
961 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
964 "PRIMARY" => ["url", "maxwidth"],
965 "created" => ["created"],
968 "openwebauth-token" => [
969 "comment" => "Store OpenWebAuth token to verify contacts",
971 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
972 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
973 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
974 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
975 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
976 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
984 "comment" => "cache for 'parse_url' queries",
986 "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
987 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
988 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
989 "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
990 "content" => ["type" => "mediumtext", "comment" => "page data"],
991 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
992 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
995 "PRIMARY" => ["url_hash", "guessing", "oembed"],
996 "created" => ["created"],
997 "expires" => ["expires"],
1001 "comment" => "personal (per user) configuration storage",
1003 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
1004 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1005 "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
1006 "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1007 "v" => ["type" => "mediumtext", "comment" => "Value"],
1010 "PRIMARY" => ["id"],
1011 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1015 "comment" => "photo storage",
1017 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1018 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1019 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1020 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1021 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1022 "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1023 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1024 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1025 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1026 "desc" => ["type" => "text", "comment" => ""],
1027 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1028 "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
1029 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1030 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1031 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1032 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1033 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1034 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1035 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1036 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1037 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1038 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1039 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1040 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1041 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1042 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1043 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1044 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1047 "PRIMARY" => ["id"],
1048 "contactid" => ["contact-id"],
1049 "uid_contactid" => ["uid", "contact-id"],
1050 "uid_profile" => ["uid", "profile"],
1051 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1052 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1053 "resource-id" => ["resource-id"],
1054 "uid_photo-type" => ["uid", "photo-type"],
1058 "comment" => "Structure for all posts",
1060 "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"],
1061 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1062 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1063 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1064 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1065 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1066 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1067 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1068 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1069 "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"],
1070 "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"],
1071 "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"],
1072 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1073 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1074 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1075 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1076 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1077 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1080 "PRIMARY" => ["uri-id"],
1081 "parent-uri-id" => ["parent-uri-id"],
1082 "thr-parent-id" => ["thr-parent-id"],
1083 "external-id" => ["external-id"],
1084 "owner-id" => ["owner-id"],
1085 "author-id" => ["author-id"],
1086 "causer-id" => ["causer-id"],
1090 "post-category" => [
1091 "comment" => "post relation to categories",
1093 "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"],
1094 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1095 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1096 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1099 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1100 "uri-id" => ["tid"],
1105 "comment" => "Content for all posts",
1107 "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"],
1108 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1109 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1110 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1111 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1112 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1113 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1114 "language" => ["type" => "text", "comment" => "Language information about this post"],
1115 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1116 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1117 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1118 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1119 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1120 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1121 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1122 "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"],
1123 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1126 "PRIMARY" => ["uri-id"],
1127 "plink" => ["plink(191)"],
1128 "resource-id" => ["resource-id"],
1129 "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1132 "post-delivery-data" => [
1133 "comment" => "Delivery data for items",
1135 "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"],
1136 "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"],
1137 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1138 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1139 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1140 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1141 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1142 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1143 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1144 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1145 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1148 "PRIMARY" => ["uri-id"],
1152 "comment" => "Post related external links",
1154 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1155 "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"],
1156 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
1157 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1160 "PRIMARY" => ["id"],
1161 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1165 "comment" => "Attached media",
1167 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1168 "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"],
1169 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "Media URL"],
1170 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1171 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1172 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1173 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1174 "size" => ["type" => "int unsigned", "comment" => "Media size"],
1175 "preview" => ["type" => "varbinary(255)", "comment" => "Preview URL"],
1176 "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1177 "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1178 "description" => ["type" => "text", "comment" => ""],
1179 "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1180 "author-url" => ["type" => "varbinary(255)", "comment" => "URL of the author of the media"],
1181 "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1182 "author-image" => ["type" => "varbinary(255)", "comment" => "Image of the author of the media"],
1183 "publisher-url" => ["type" => "varbinary(255)", "comment" => "URL of the publisher of the media"],
1184 "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1185 "publisher-image" => ["type" => "varbinary(255)", "comment" => "Image of the publisher of the media"],
1188 "PRIMARY" => ["id"],
1189 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1193 "comment" => "post relation to tags",
1195 "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"],
1196 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1197 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1198 "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"],
1201 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1207 "comment" => "Thread related data",
1209 "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"],
1210 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1211 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1212 "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"],
1213 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1214 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1215 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1216 "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"],
1217 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1220 "PRIMARY" => ["uri-id"],
1221 "owner-id" => ["owner-id"],
1222 "author-id" => ["author-id"],
1223 "causer-id" => ["causer-id"],
1224 "received" => ["received"],
1225 "commented" => ["commented"],
1229 "comment" => "User specific post data",
1231 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1232 "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"],
1233 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1234 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1235 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1236 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1237 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1238 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1239 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1240 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1241 "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"],
1242 "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"],
1243 "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"],
1244 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1245 "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1246 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1247 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1248 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1249 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1250 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1251 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1252 "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1253 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1254 "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1255 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1256 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1257 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1258 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1259 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1260 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1263 "PRIMARY" => ["id"],
1264 "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1265 "uri-id" => ["uri-id"],
1266 "parent-uri-id" => ["parent-uri-id"],
1267 "thr-parent-id" => ["thr-parent-id"],
1268 "external-id" => ["external-id"],
1269 "owner-id" => ["owner-id"],
1270 "author-id" => ["author-id"],
1271 "causer-id" => ["causer-id"],
1273 "contact-id" => ["contact-id"],
1274 "event-id" => ["event-id"],
1276 "author-id_uid" => ["author-id", "uid"],
1277 "author-id_received" => ["author-id", "received"],
1278 "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1279 "uid_contactid" => ["uid", "contact-id"],
1280 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1281 "uid_unseen" => ["uid", "unseen"],
1282 "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1285 "post-thread-user" => [
1286 "comment" => "Thread related data per user",
1288 "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"],
1289 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1290 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1291 "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"],
1292 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1293 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1294 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1295 "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"],
1296 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1297 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1298 "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The thread is pinned on the profile page"],
1299 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1300 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1301 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1302 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1303 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1304 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
1305 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1306 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1307 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1308 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1309 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1310 "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1313 "PRIMARY" => ["uid", "uri-id"],
1314 "uri-id" => ["uri-id"],
1315 "owner-id" => ["owner-id"],
1316 "author-id" => ["author-id"],
1317 "causer-id" => ["causer-id"],
1319 "contact-id" => ["contact-id"],
1321 "post-user-id" => ["post-user-id"],
1322 "commented" => ["commented"],
1323 "uid_received" => ["uid", "received"],
1324 "uid_wall_received" => ["uid", "wall", "received"],
1325 "uid_pinned" => ["uid", "pinned"],
1326 "uid_commented" => ["uid", "commented"],
1327 "uid_starred" => ["uid", "starred"],
1328 "uid_mention" => ["uid", "mention"],
1331 "post-user-notification" => [
1332 "comment" => "User post notifications",
1334 "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"],
1335 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1336 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1339 "PRIMARY" => ["uid", "uri-id"],
1340 "uri-id" => ["uri-id"],
1344 "comment" => "Currently running system processes",
1346 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1347 "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
1348 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1349 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1352 "PRIMARY" => ["pid", "hostname"],
1353 "command" => ["command"],
1357 "comment" => "user profiles data",
1359 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1360 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1361 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1362 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1363 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1364 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1365 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1366 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1367 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1368 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1369 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1370 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1371 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1372 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1373 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1374 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1375 "with" => ["type" => "text", "comment" => "Deprecated"],
1376 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1377 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1378 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1379 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1380 "pub_keywords" => ["type" => "text", "comment" => ""],
1381 "prv_keywords" => ["type" => "text", "comment" => ""],
1382 "likes" => ["type" => "text", "comment" => "Deprecated"],
1383 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1384 "about" => ["type" => "text", "comment" => "Profile description"],
1385 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1386 "music" => ["type" => "text", "comment" => "Deprecated"],
1387 "book" => ["type" => "text", "comment" => "Deprecated"],
1388 "tv" => ["type" => "text", "comment" => "Deprecated"],
1389 "film" => ["type" => "text", "comment" => "Deprecated"],
1390 "interest" => ["type" => "text", "comment" => "Deprecated"],
1391 "romance" => ["type" => "text", "comment" => "Deprecated"],
1392 "work" => ["type" => "text", "comment" => "Deprecated"],
1393 "education" => ["type" => "text", "comment" => "Deprecated"],
1394 "contact" => ["type" => "text", "comment" => "Deprecated"],
1395 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1396 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
1397 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
1398 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1399 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1400 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1401 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1404 "PRIMARY" => ["id"],
1405 "uid_is-default" => ["uid", "is-default"],
1406 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1409 "profile_field" => [
1410 "comment" => "Custom profile fields",
1412 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1413 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1414 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1415 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1416 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1417 "value" => ["type" => "text", "comment" => "Value of the field"],
1418 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1419 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1422 "PRIMARY" => ["id"],
1424 "order" => ["order"],
1428 "push_subscriber" => [
1429 "comment" => "Used for OStatus: Contains feed subscribers",
1431 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1432 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1433 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1434 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1435 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1436 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1437 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1438 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1439 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1440 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1443 "PRIMARY" => ["id"],
1444 "next_try" => ["next_try"],
1449 "comment" => "registrations requiring admin approval",
1451 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1452 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1453 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1454 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1455 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1456 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1457 "note" => ["type" => "text", "comment" => ""],
1460 "PRIMARY" => ["id"],
1467 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1468 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1469 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1472 "PRIMARY" => ["id"],
1473 "uid_term" => ["uid", "term(64)"],
1474 "term" => ["term(64)"]
1478 "comment" => "web session storage",
1480 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1481 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1482 "data" => ["type" => "text", "comment" => ""],
1483 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1486 "PRIMARY" => ["id"],
1487 "sid" => ["sid(64)"],
1488 "expire" => ["expire"],
1492 "comment" => "Data stored by Database storage backend",
1494 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1495 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1502 "comment" => "Push Subscription for the API",
1504 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1505 "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""],
1506 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1507 "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"],
1508 "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"],
1509 "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"],
1510 "follow" => ["type" => "boolean", "comment" => ""],
1511 "favourite" => ["type" => "boolean", "comment" => ""],
1512 "reblog" => ["type" => "boolean", "comment" => ""],
1513 "mention" => ["type" => "boolean", "comment" => ""],
1514 "poll" => ["type" => "boolean", "comment" => ""],
1515 "follow_request" => ["type" => "boolean", "comment" => ""],
1516 "status" => ["type" => "boolean", "comment" => ""],
1519 "PRIMARY" => ["id"],
1520 "application-id_uid" => ["UNIQUE", "application-id", "uid"],
1521 "uid_application-id" => ["uid", "application-id"],
1525 "comment" => "Deleted usernames",
1527 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1528 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1531 "PRIMARY" => ["id"],
1532 "username" => ["username(32)"],
1536 "comment" => "User specific public contact data",
1538 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1539 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1540 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
1541 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1542 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1543 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
1544 "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
1545 "pending" => ["type" => "boolean", "comment" => ""],
1546 "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
1547 "info" => ["type" => "mediumtext", "comment" => ""],
1548 "notify_new_posts" => ["type" => "boolean", "comment" => ""],
1549 "remote_self" => ["type" => "boolean", "comment" => ""],
1550 "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => ""],
1551 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
1552 "subhub" => ["type" => "boolean", "comment" => ""],
1553 "hub-verify" => ["type" => "varchar(255)", "comment" => ""],
1554 "protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
1555 "rating" => ["type" => "tinyint", "comment" => "Automatically detected feed poll frequency"],
1556 "priority" => ["type" => "tinyint unsigned", "comment" => "Feed poll priority"],
1559 "PRIMARY" => ["uid", "cid"],
1561 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
1565 "comment" => "Inter process communication between the frontend and the worker",
1567 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1568 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1571 "PRIMARY" => ["key"],
1573 "engine" => "MEMORY",