3 * @copyright Copyright (C) 2010-2023, 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 // This file is required several times during the test in DbaDefinition which justifies this condition
58 if (!defined('DB_UPDATE_VERSION')) {
59 define('DB_UPDATE_VERSION', 1543);
65 "comment" => "Global servers",
67 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
68 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
69 "nurl" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
70 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
71 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
72 "info" => ["type" => "text", "comment" => ""],
73 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
74 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
75 "active-week-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last week"],
76 "active-month-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last month"],
77 "active-halfyear-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last six month"],
78 "local-posts" => ["type" => "int unsigned", "comment" => "Number of local posts"],
79 "local-comments" => ["type" => "int unsigned", "comment" => "Number of local comments"],
80 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
81 "poco" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
82 "noscrape" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
83 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
84 "protocol" => ["type" => "tinyint unsigned", "comment" => "The protocol of the server"],
85 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
86 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
87 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
88 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
89 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
90 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
91 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last successful connection request"],
92 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last failed connection request"],
93 "blocked" => ["type" => "boolean", "comment" => "Server is blocked"],
94 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
95 "next_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Next connection request"],
99 "nurl" => ["UNIQUE", "nurl(190)"],
100 "next_contact" => ["next_contact"],
101 "network" => ["network"],
105 "comment" => "The local users",
107 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
108 "parent-uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "The parent user that has full control about this user"],
109 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
110 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
111 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
112 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
113 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
114 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
115 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
116 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
117 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
118 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
119 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
120 "last-activity" => ["type" => "date", "comment" => "Day of the last activity"],
121 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
122 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
123 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
124 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
125 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
126 "spubkey" => ["type" => "text", "comment" => ""],
127 "sprvkey" => ["type" => "text", "comment" => ""],
128 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
129 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
130 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
131 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unknown viewers"],
132 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
133 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
134 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
135 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
136 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
137 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
138 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
139 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
140 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
141 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
142 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Delay in days before deleting user-related posts. Scope is controlled by pConfig."],
143 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
144 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
145 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
146 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
147 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
148 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
149 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
150 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
151 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
152 "openidserver" => ["type" => "text", "comment" => ""],
155 "PRIMARY" => ["uid"],
156 "nickname" => ["nickname(32)"],
157 "parent-uid" => ["parent-uid"],
159 "email" => ["email(64)"],
163 "comment" => "User settings about remote servers",
165 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "primary" => "1", "comment" => "Owner User id"],
166 "gsid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1", "comment" => "Gserver id"],
167 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "server accounts are ignored for the user"],
170 "PRIMARY" => ["uid", "gsid"],
175 "comment" => "URI and GUID for items",
177 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
178 "uri" => ["type" => "varbinary(383)", "not null" => "1", "comment" => "URI of an item"],
179 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
183 "uri" => ["UNIQUE", "uri"],
188 "comment" => "contact table",
190 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
191 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
192 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
193 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
194 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
195 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
196 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
197 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
198 "about" => ["type" => "text", "comment" => ""],
199 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
200 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
201 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
202 "avatar" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
203 "blurhash" => ["type" => "varbinary(255)", "comment" => "BlurHash representation of the avatar"],
204 "header" => ["type" => "varbinary(383)", "comment" => "Header picture"],
205 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
206 "nurl" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
207 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
208 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
209 "alias" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
210 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
211 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
212 "batch" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
213 "notify" => ["type" => "varbinary(383)", "comment" => ""],
214 "poll" => ["type" => "varbinary(383)", "comment" => ""],
215 "subscribe" => ["type" => "varbinary(383)", "comment" => ""],
216 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
217 "next-update" => ["type" => "datetime", "comment" => "Next connection request"],
218 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
219 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
220 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
221 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
222 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
223 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
224 "local-data" => ["type" => "boolean", "comment" => "Is true when there are posts with this contact on the system"],
225 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
226 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
227 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
228 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Person, organisation, news, community, relay"],
229 "manually-approve" => ["type" => "boolean", "comment" => "Contact requests have to be approved manually"],
230 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
231 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
232 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
233 "baseurl" => ["type" => "varbinary(383)", "default" => "", "comment" => "baseurl of the contact from the gserver record, can be missing"],
234 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID, can be missing"],
235 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
236 // User depending fields
237 "reason" => ["type" => "text", "comment" => ""],
238 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
239 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
240 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
241 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
242 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
243 "hub-verify" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
244 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Automatically detected feed poll frequency"],
245 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Feed poll priority"],
246 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
247 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
248 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Contact request is pending"],
249 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
250 "info" => ["type" => "mediumtext", "comment" => ""],
251 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
252 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
253 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
254 // Deprecated, but still in use
255 "photo" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo of the contact"],
256 "thumb" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
257 "micro" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
258 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
259 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
260 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
261 "request" => ["type" => "varbinary(383)", "comment" => ""],
262 "confirm" => ["type" => "varbinary(383)", "comment" => ""],
263 "poco" => ["type" => "varbinary(383)", "comment" => ""],
264 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
265 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead"],
266 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead"],
267 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
268 // Deprecated fields that aren't in use anymore
269 "site-pubkey" => ["type" => "text", "comment" => "Deprecated"],
270 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
271 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
272 "issued-id" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
273 "dfrn-id" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
274 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
275 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
276 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
277 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => "Deprecated"],
278 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
282 "uid_name" => ["uid", "name(190)"],
283 "self_uid" => ["self", "uid"],
284 "alias_uid" => ["alias(128)", "uid"],
285 "pending_uid" => ["pending", "uid"],
286 "blocked_uid" => ["blocked", "uid"],
287 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
288 "uid_network_batch" => ["uid", "network", "batch(64)"],
289 "batch_contact-type" => ["batch(64)", "contact-type"],
290 "addr_uid" => ["addr(128)", "uid"],
291 "nurl_uid" => ["nurl(128)", "uid"],
292 "nick_uid" => ["nick(128)", "uid"],
293 "attag_uid" => ["attag(96)", "uid"],
294 "network_uid_lastupdate" => ["network", "uid", "last-update"],
295 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
296 "next-update" => ["next-update"],
297 "local-data-next-update" => ["local-data", "next-update"],
298 "uid_lastitem" => ["uid", "last-item"],
299 "baseurl" => ["baseurl(64)"],
300 "uid_contact-type" => ["uid", "contact-type"],
301 "uid_self_contact-type" => ["uid", "self", "contact-type"],
302 "self_network_uid" => ["self", "network", "uid"],
303 "gsid_uid_failed" => ["gsid", "uid", "failed"],
304 "uri-id" => ["uri-id"],
308 "comment" => "tags and mentions",
310 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
311 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
312 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
313 "type" => ["type" => "tinyint unsigned", "comment" => "Type of the tag (Unknown, General Collection, Follower Collection or Account)"],
317 "type_name_url" => ["UNIQUE", "name", "url"],
324 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
325 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
326 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
327 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed circles"],
328 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
329 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied circles"],
333 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
337 "comment" => "Activity Verbs",
339 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
340 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
348 "2fa_app_specific_password" => [
349 "comment" => "Two-factor app-specific _password",
351 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
352 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
353 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
354 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
355 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
356 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
360 "uid_description" => ["uid", "description(190)"],
363 "2fa_recovery_codes" => [
364 "comment" => "Two-factor authentication recovery codes",
366 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
367 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
368 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
369 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
372 "PRIMARY" => ["uid", "code"]
375 "2fa_trusted_browser" => [
376 "comment" => "Two-factor authentication trusted browsers",
378 "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
379 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
380 "user_agent" => ["type" => "text", "comment" => "User agent string"],
381 "trusted" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Whenever this browser should be trusted or not"],
382 "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
383 "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
386 "PRIMARY" => ["cookie_hash"],
390 "account-suggestion" => [
391 "comment" => "Account suggestion",
393 "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 account url"],
394 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
395 "level" => ["type" => "smallint unsigned", "comment" => "level of closeness"],
396 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "If set, this account will not be suggested again"],
399 "PRIMARY" => ["uid", "uri-id"],
400 "uri-id_uid" => ["uri-id", "uid"],
404 "comment" => "Remote and local accounts",
406 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
407 "uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the account url"],
408 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
412 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
413 "uid_uri-id" => ["uid", "uri-id"],
417 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
419 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
420 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
421 "uuid" => ["type" => "varbinary(255)", "comment" => ""],
422 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
423 "following" => ["type" => "varbinary(383)", "comment" => ""],
424 "followers" => ["type" => "varbinary(383)", "comment" => ""],
425 "inbox" => ["type" => "varbinary(383)", "not null" => "1", "comment" => ""],
426 "outbox" => ["type" => "varbinary(383)", "comment" => ""],
427 "sharedinbox" => ["type" => "varbinary(383)", "comment" => ""],
428 "featured" => ["type" => "varbinary(383)", "comment" => "Address for the collection of featured posts"],
429 "featured-tags" => ["type" => "varbinary(383)", "comment" => "Address for the collection of featured tags"],
430 "manually-approve" => ["type" => "boolean", "comment" => ""],
431 "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
432 "suspended" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is suspended"],
433 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
434 "name" => ["type" => "varchar(255)", "comment" => ""],
435 "about" => ["type" => "text", "comment" => ""],
436 "xmpp" => ["type" => "varchar(255)", "comment" => "XMPP address"],
437 "matrix" => ["type" => "varchar(255)", "comment" => "Matrix address"],
438 "photo" => ["type" => "varbinary(383)", "comment" => ""],
439 "header" => ["type" => "varbinary(383)", "comment" => "Header picture"],
440 "addr" => ["type" => "varchar(255)", "comment" => ""],
441 "alias" => ["type" => "varbinary(383)", "comment" => ""],
442 "pubkey" => ["type" => "text", "comment" => ""],
443 "subscribe" => ["type" => "varbinary(383)", "comment" => ""],
444 "baseurl" => ["type" => "varbinary(383)", "comment" => "baseurl of the ap contact"],
445 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
446 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
447 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
448 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
449 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
450 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
453 "PRIMARY" => ["url"],
454 "addr" => ["addr(32)"],
455 "alias" => ["alias(190)"],
456 "followers" => ["followers(190)"],
457 "baseurl" => ["baseurl(190)"],
458 "sharedinbox" => ["sharedinbox(190)"],
460 "uri-id" => ["UNIQUE", "uri-id"],
464 "comment" => "OAuth application",
466 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
467 "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
468 "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
469 "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
470 "redirect_uri" => ["type" => "varbinary(383)", "not null" => "1", "comment" => ""],
471 "website" => ["type" => "varbinary(383)", "comment" => ""],
472 "scopes" => ["type" => "varchar(255)", "comment" => ""],
473 "read" => ["type" => "boolean", "comment" => "Read scope"],
474 "write" => ["type" => "boolean", "comment" => "Write scope"],
475 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
476 "push" => ["type" => "boolean", "comment" => "Push scope"],
480 "client_id" => ["UNIQUE", "client_id"]
483 "application-marker" => [
484 "comment" => "Timeline marker",
486 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
487 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
488 "timeline" => ["type" => "varchar(64)", "not null" => "1", "primary" => "1", "comment" => "Marker (home, notifications)"],
489 "last_read_id" => ["type" => "varbinary(383)", "comment" => "Marker id for the timeline"],
490 "version" => ["type" => "smallint unsigned", "comment" => "Version number"],
491 "updated_at" => ["type" => "datetime", "comment" => "creation time"],
494 "PRIMARY" => ["application-id", "uid", "timeline"],
498 "application-token" => [
499 "comment" => "OAuth user token",
501 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
502 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
503 "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
504 "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
505 "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
506 "scopes" => ["type" => "varchar(255)", "comment" => ""],
507 "read" => ["type" => "boolean", "comment" => "Read scope"],
508 "write" => ["type" => "boolean", "comment" => "Write scope"],
509 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
510 "push" => ["type" => "boolean", "comment" => "Push scope"],
513 "PRIMARY" => ["application-id", "uid"],
514 "uid_id" => ["uid", "application-id"],
518 "comment" => "file attachments",
520 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
521 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
522 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
523 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
524 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
525 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
526 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
527 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
528 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
529 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
530 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed circles"],
531 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
532 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied circles"],
533 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
534 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
542 "comment" => "Stores temporary data",
544 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
545 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
546 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
547 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
551 "k_expires" => ["k", "expires"],
555 "comment" => "User defined Channels",
557 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
558 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
559 "label" => ["type" => "varchar(64)", "not null" => "1", "comment" => "Channel label"],
560 "description" => ["type" => "varchar(64)", "comment" => "Channel description"],
561 "circle" => ["type" => "int", "comment" => "Circle or channel that this channel is based on"],
562 "access-key" => ["type" => "varchar(1)", "comment" => "Access key"],
563 "include-tags" => ["type" => "varchar(1023)", "comment" => "Comma separated list of tags that will be included in the channel"],
564 "exclude-tags" => ["type" => "varchar(1023)", "comment" => "Comma separated list of tags that aren't allowed in the channel"],
565 "full-text-search" => ["type" => "varchar(1023)", "comment" => "Full text search pattern, see https://mariadb.com/kb/en/full-text-index-overview/#in-boolean-mode"],
566 "media-type" => ["type" => "smallint unsigned", "comment" => "Filtered media types"],
574 "comment" => "main configuration storage",
576 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
577 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => "The category of the entry"],
578 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => "The key of the entry"],
579 "v" => ["type" => "mediumtext", "comment" => ""],
583 "cat_k" => ["UNIQUE", "cat", "k"],
586 "contact-relation" => [
587 "comment" => "Contact relations",
589 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
590 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
591 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction by relation-cid on cid"],
592 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
593 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if true, relation-cid follows cid"],
594 "score" => ["type" => "smallint unsigned", "comment" => "score for interactions of cid on relation-cid"],
595 "relation-score" => ["type" => "smallint unsigned", "comment" => "score for interactions of relation-cid on cid"],
596 "thread-score" => ["type" => "smallint unsigned", "comment" => "score for interactions of cid on threads of relation-cid"],
597 "relation-thread-score" => ["type" => "smallint unsigned", "comment" => "score for interactions of relation-cid on threads of cid"],
600 "PRIMARY" => ["cid", "relation-cid"],
601 "relation-cid" => ["relation-cid"],
605 "comment" => "private messages",
607 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
608 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
609 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
610 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
611 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
612 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
613 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
614 "subject" => ["type" => "text", "comment" => "subject of initial message"],
622 "comment" => "Background tasks queue entries",
624 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
625 "command" => ["type" => "varchar(100)", "comment" => "Task command"],
626 "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
627 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
628 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
629 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
630 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
631 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
632 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
633 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
637 "command" => ["command"],
638 "done_command_parameter" => ["done", "command", "parameter(64)"],
639 "done_executed" => ["done", "executed"],
640 "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
641 "done_priority_next_try" => ["done", "priority", "next_try"],
642 "done_pid_next_try" => ["done", "pid", "next_try"],
643 "done_pid_retrial" => ["done", "pid", "retrial"],
644 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
648 "comment" => "Posts that are about to be distributed at a later time",
650 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
651 "uri" => ["type" => "varbinary(383)", "comment" => "URI of the post that will be distributed later"],
652 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
653 "delayed" => ["type" => "datetime", "comment" => "delay time"],
654 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
658 "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
662 "delivery-queue" => [
663 "comment" => "Delivery data for posts for the batch processing",
665 "gsid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Target server"],
666 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Delivered post"],
667 "created" => ["type" => "datetime", "comment" => ""],
668 "command" => ["type" => "varbinary(32)", "comment" => ""],
669 "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Target contact"],
670 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Delivering user"],
671 "failed" => ["type" => "tinyint", "default" => 0, "comment" => "Number of times the delivery has failed"],
674 "PRIMARY" => ["uri-id", "gsid"],
675 "gsid_created" => ["gsid", "created"],
680 "diaspora-contact" => [
681 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
683 "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 contact URL"],
684 "addr" => ["type" => "varchar(255)", "comment" => ""],
685 "alias" => ["type" => "varchar(255)", "comment" => ""],
686 "nick" => ["type" => "varchar(255)", "comment" => ""],
687 "name" => ["type" => "varchar(255)", "comment" => ""],
688 "given-name" => ["type" => "varchar(255)", "comment" => ""],
689 "family-name" => ["type" => "varchar(255)", "comment" => ""],
690 "photo" => ["type" => "varchar(255)", "comment" => ""],
691 "photo-medium" => ["type" => "varchar(255)", "comment" => ""],
692 "photo-small" => ["type" => "varchar(255)", "comment" => ""],
693 "batch" => ["type" => "varchar(255)", "comment" => ""],
694 "notify" => ["type" => "varchar(255)", "comment" => ""],
695 "poll" => ["type" => "varchar(255)", "comment" => ""],
696 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
697 "searchable" => ["type" => "boolean", "comment" => ""],
698 "pubkey" => ["type" => "text", "comment" => ""],
699 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
700 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
701 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
702 "interacting_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts this contact interacts with"],
703 "interacted_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts that interacted with this contact"],
704 "post_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts and comments"],
707 "PRIMARY" => ["uri-id"],
708 "addr" => ["UNIQUE", "addr"],
709 "alias" => ["alias"],
713 "diaspora-interaction" => [
714 "comment" => "Signed Diaspora Interaction",
716 "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"],
717 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
720 "PRIMARY" => ["uri-id"]
724 "comment" => "ActivityPub endpoints - used in the ActivityPub implementation",
726 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
727 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
728 "owner-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
731 "PRIMARY" => ["url"],
732 "owner-uri-id_type" => ["UNIQUE", "owner-uri-id", "type"],
736 "comment" => "Events",
738 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
739 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
740 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
741 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
742 "uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
743 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
744 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
745 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
746 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
747 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
748 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
749 "desc" => ["type" => "text", "comment" => "event description"],
750 "location" => ["type" => "text", "comment" => "event location"],
751 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
752 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
753 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
754 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
755 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed circles"],
756 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
757 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied circles"],
761 "uid_start" => ["uid", "start"],
763 "uri-id" => ["uri-id"],
769 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
770 "url" => ["type" => "varbinary(383)", "comment" => "url that awaiting to be fetched"],
771 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of the fetch request"],
772 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
776 "url" => ["UNIQUE", "url"],
777 "created" => ["created"],
782 "comment" => "friend suggestion stuff",
784 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
785 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
786 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
787 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
788 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
789 "request" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
790 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
791 "note" => ["type" => "text", "comment" => ""],
792 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
801 "comment" => "privacy circles, circle info",
803 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
804 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
805 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
806 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the circle has been deleted"],
807 "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of group. When this field is filled then the members are synced automatically."],
808 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of circle"],
817 "comment" => "privacy circles, member info",
819 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
820 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "group.id of the associated circle"],
821 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated circle"],
825 "contactid" => ["contact-id"],
826 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
830 "comment" => "Tags that the server has subscribed",
832 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1", "comment" => "The id of the gserver"],
833 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
836 "PRIMARY" => ["gserver-id", "tag"],
841 "comment" => "addon hook registry",
843 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
844 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
845 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
846 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
847 "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"],
851 "priority" => ["priority"],
852 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
856 "comment" => "Incoming activity",
858 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
859 "activity-id" => ["type" => "varbinary(383)", "comment" => "id of the incoming activity"],
860 "object-id" => ["type" => "varbinary(383)", "comment" => ""],
861 "in-reply-to-id" => ["type" => "varbinary(383)", "comment" => ""],
862 "conversation" => ["type" => "varbinary(383)", "comment" => ""],
863 "type" => ["type" => "varchar(64)", "comment" => "Type of the activity"],
864 "object-type" => ["type" => "varchar(64)", "comment" => "Type of the object activity"],
865 "object-object-type" => ["type" => "varchar(64)", "comment" => "Type of the object's object activity"],
866 "received" => ["type" => "datetime", "comment" => "Receiving date"],
867 "activity" => ["type" => "mediumtext", "comment" => "The JSON activity"],
868 "signer" => ["type" => "varchar(255)", "comment" => ""],
869 "push" => ["type" => "boolean", "comment" => "Is the entry pushed or have pulled it?"],
870 "trust" => ["type" => "boolean", "comment" => "Do we trust this entry?"],
871 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
875 "activity-id" => ["UNIQUE", "activity-id"],
876 "object-id" => ["object-id"],
877 "received" => ["received"],
881 "inbox-entry-receiver" => [
882 "comment" => "Receiver for the incoming activity",
884 "queue-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["inbox-entry" => "id"], "comment" => ""],
885 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
888 "PRIMARY" => ["queue-id", "uid"],
893 "comment" => "Status of ActivityPub inboxes",
895 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
896 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
897 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "ID of the related server"],
898 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
899 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
900 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
901 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
902 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
903 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
906 "PRIMARY" => ["url"],
907 "uri-id" => ["uri-id"],
914 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
915 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
916 "fid" => ["type" => "int unsigned", "comment" => "deprecated"],
917 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
918 "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
919 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
920 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
921 "note" => ["type" => "text", "comment" => ""],
922 "hash" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
923 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
924 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
925 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
929 "contact-id" => ["contact-id"],
930 "suggest-cid" => ["suggest-cid"],
935 "comment" => "A key value storage",
937 "k" => ["type" => "varbinary(50)", "not null" => "1", "primary" => "1", "comment" => ""],
938 "v" => ["type" => "mediumtext", "comment" => ""],
939 "updated_at" => ["type" => "int unsigned", "not null" => "1", "comment" => "timestamp of the last update"],
948 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
949 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
950 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
951 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
952 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
956 "name_expires" => ["name", "expires"]
960 "comment" => "private messages",
962 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
963 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
964 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
965 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
966 "from-photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
967 "from-url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "profile link of the sender"],
968 "contact-id" => ["type" => "varbinary(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
969 "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"],
970 "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
971 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
972 "body" => ["type" => "mediumtext", "comment" => ""],
973 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
974 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
975 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
976 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
977 "uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
978 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
979 "parent-uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
980 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
981 "thr-parent" => ["type" => "varbinary(383)", "comment" => ""],
982 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
983 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
987 "uid_seen" => ["uid", "seen"],
988 "convid" => ["convid"],
989 "uri" => ["uri(64)"],
990 "parent-uri" => ["parent-uri(64)"],
991 "contactid" => ["contact-id(32)"],
992 "author-id" => ["author-id"],
993 "uri-id" => ["uri-id"],
994 "parent-uri-id" => ["parent-uri-id"],
995 "thr-parent-id" => ["thr-parent-id"],
999 "comment" => "Mail account data for fetching mails",
1001 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1002 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1003 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1004 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1005 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1006 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1007 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1008 "pass" => ["type" => "text", "comment" => ""],
1009 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1010 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1011 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1012 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1013 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1016 "PRIMARY" => ["id"],
1021 "comment" => "table of accounts that can manage each other",
1023 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1024 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1025 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1028 "PRIMARY" => ["id"],
1029 "uid_mid" => ["UNIQUE", "uid", "mid"],
1034 "comment" => "notifications",
1036 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1037 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1038 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1039 "type" => ["type" => "smallint unsigned", "comment" => ""],
1040 "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
1041 "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
1042 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1043 "created" => ["type" => "datetime", "comment" => ""],
1044 "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
1045 "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
1048 "PRIMARY" => ["id"],
1049 "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
1051 "actor-id" => ["actor-id"],
1052 "target-uri-id" => ["target-uri-id"],
1053 "parent-uri-id" => ["parent-uri-id"],
1054 "seen_uid" => ["seen", "uid"],
1055 "uid_type_parent-uri-id_actor-id" => ["uid", "type", "parent-uri-id", "actor-id"],
1059 "comment" => "[Deprecated] User notifications",
1061 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1062 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1063 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1064 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1065 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1066 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1067 "msg" => ["type" => "mediumtext", "comment" => ""],
1068 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1069 "link" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1070 "iid" => ["type" => "int unsigned", "comment" => ""],
1071 "parent" => ["type" => "int unsigned", "comment" => ""],
1072 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
1073 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1074 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1075 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
1076 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
1077 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
1078 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
1081 "PRIMARY" => ["id"],
1082 "seen_uid_date" => ["seen", "uid", "date"],
1083 "uid_date" => ["uid", "date"],
1084 "uid_type_link" => ["uid", "type", "link(190)"],
1085 "uri-id" => ["uri-id"],
1086 "parent-uri-id" => ["parent-uri-id"],
1089 "notify-threads" => [
1092 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1093 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
1094 "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
1095 "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1096 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1097 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1100 "PRIMARY" => ["id"],
1101 "master-parent-uri-id" => ["master-parent-uri-id"],
1102 "receiver-uid" => ["receiver-uid"],
1103 "notify-id" => ["notify-id"],
1107 "comment" => "cache for OEmbed queries",
1109 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1110 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
1111 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
1112 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1115 "PRIMARY" => ["url", "maxwidth"],
1116 "created" => ["created"],
1119 "openwebauth-token" => [
1120 "comment" => "Store OpenWebAuth token to verify contacts",
1122 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1123 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
1124 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1125 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1126 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1127 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1130 "PRIMARY" => ["id"],
1135 "comment" => "cache for 'parse_url' queries",
1137 "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
1138 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1139 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1140 "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
1141 "content" => ["type" => "mediumtext", "comment" => "page data"],
1142 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1143 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
1146 "PRIMARY" => ["url_hash", "guessing", "oembed"],
1147 "created" => ["created"],
1148 "expires" => ["expires"],
1152 "comment" => "personal (per user) configuration storage",
1154 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
1155 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1156 "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
1157 "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1158 "v" => ["type" => "mediumtext", "comment" => "Value"],
1161 "PRIMARY" => ["id"],
1162 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1166 "comment" => "photo storage",
1168 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1169 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1170 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1171 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1172 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1173 "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1174 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1175 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1176 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1177 "desc" => ["type" => "text", "comment" => ""],
1178 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1179 "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
1180 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1181 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1182 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1183 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1184 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1185 "blurhash" => ["type" => "varbinary(255)", "comment" => "BlurHash representation of the photo"],
1186 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1187 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1188 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1189 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1190 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed circles"],
1191 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1192 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied circles"],
1193 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1194 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1195 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1196 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1199 "PRIMARY" => ["id"],
1200 "contactid" => ["contact-id"],
1201 "uid_contactid" => ["uid", "contact-id"],
1202 "uid_profile" => ["uid", "profile"],
1203 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1204 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1205 "resource-id" => ["resource-id"],
1206 "uid_photo-type" => ["uid", "photo-type"],
1210 "comment" => "Structure for all posts",
1212 "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"],
1213 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1214 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1215 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1216 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1217 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1218 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1219 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1220 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1221 "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"],
1222 "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"],
1223 "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"],
1224 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1225 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1226 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1227 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1228 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1229 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1232 "PRIMARY" => ["uri-id"],
1233 "parent-uri-id" => ["parent-uri-id"],
1234 "thr-parent-id" => ["thr-parent-id"],
1235 "external-id" => ["external-id"],
1236 "owner-id" => ["owner-id"],
1237 "author-id" => ["author-id"],
1238 "causer-id" => ["causer-id"],
1242 "post-activity" => [
1243 "comment" => "Original remote activity",
1245 "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"],
1246 "activity" => ["type" => "mediumtext", "comment" => "Original activity"],
1247 "received" => ["type" => "datetime", "comment" => ""],
1250 "PRIMARY" => ["uri-id"],
1253 "post-category" => [
1254 "comment" => "post relation to categories",
1256 "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"],
1257 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1258 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1259 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1262 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1264 "uid_uri-id" => ["uid", "uri-id"],
1268 "comment" => "Original remote activity",
1270 "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"],
1271 "vid" => ["type" => "smallint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1272 "reaction" => ["type" => "varchar(1)", "not null" => "1", "primary" => "1", "comment" => "Emoji Reaction"],
1273 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1274 "count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of activities"],
1277 "PRIMARY" => ["uri-id", "vid", "reaction"],
1279 "parent-uri-id" => ["parent-uri-id"],
1282 "post-collection" => [
1283 "comment" => "Collection of posts",
1285 "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"],
1286 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "0 - Featured"],
1287 "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Author of the featured post"],
1290 "PRIMARY" => ["uri-id", "type"],
1292 "author-id" => ["author-id"],
1296 "comment" => "Content for all posts",
1298 "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"],
1299 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1300 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1301 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1302 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1303 "quote-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the quoted uri"],
1304 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1305 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1306 "language" => ["type" => "text", "comment" => "Language information about this post"],
1307 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1308 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1309 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1310 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1311 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1312 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1313 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1314 "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"],
1315 "plink" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1318 "PRIMARY" => ["uri-id"],
1319 "plink" => ["plink(191)"],
1320 "resource-id" => ["resource-id"],
1321 "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1322 "quote-uri-id" => ["quote-uri-id"],
1325 "post-delivery" => [
1326 "comment" => "Delivery data for posts for the batch processing",
1328 "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"],
1329 "inbox-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
1330 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Delivering user"],
1331 "created" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
1332 "command" => ["type" => "varbinary(32)", "comment" => ""],
1333 "failed" => ["type" => "tinyint", "default" => 0, "comment" => "Number of times the delivery has failed"],
1334 "receivers" => ["type" => "mediumtext", "comment" => "JSON encoded array with the receiving contacts"],
1337 "PRIMARY" => ["uri-id", "inbox-id"],
1338 "inbox-id_created" => ["inbox-id", "created"],
1342 "post-delivery-data" => [
1343 "comment" => "Delivery data for items",
1345 "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"],
1346 "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"],
1347 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1348 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1349 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1350 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1351 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1352 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1353 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1354 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1355 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1358 "PRIMARY" => ["uri-id"],
1361 "post-engagement" => [
1362 "comment" => "Engagement data per post",
1364 "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"],
1365 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "Item owner"],
1366 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Person, organisation, news, community, relay"],
1367 "media-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Type of media in a bit array (1 = image, 2 = video, 4 = audio"],
1368 "language" => ["type" => "varbinary(128)", "comment" => "Language information about this post"],
1369 "searchtext" => ["type" => "mediumtext", "comment" => "Simplified text for the full text search"],
1370 "created" => ["type" => "datetime", "comment" => ""],
1371 "restricted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "If true, this post is either unlisted or not from a federated network"],
1372 "comments" => ["type" => "mediumint unsigned", "comment" => "Number of comments"],
1373 "activities" => ["type" => "mediumint unsigned", "comment" => "Number of activities (like, dislike, ...)"],
1376 "PRIMARY" => ["uri-id"],
1377 "owner-id" => ["owner-id"],
1378 "created" => ["created"],
1379 "searchtext" => ["FULLTEXT", "searchtext"],
1383 "comment" => "Post history",
1385 "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"],
1386 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "primary" => "1", "comment" => "Date of edit"],
1387 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1388 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1389 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1390 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1391 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1392 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1393 "language" => ["type" => "text", "comment" => "Language information about this post"],
1394 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1395 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1396 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1397 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1398 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1399 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1400 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1401 "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"],
1402 "plink" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1405 "PRIMARY" => ["uri-id", "edited"],
1409 "comment" => "Post related external links",
1411 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1412 "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"],
1413 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
1414 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1415 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1416 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1417 "blurhash" => ["type" => "varbinary(255)", "comment" => "BlurHash representation of the link"],
1420 "PRIMARY" => ["id"],
1421 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1425 "comment" => "Attached media",
1427 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1428 "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"],
1429 "url" => ["type" => "varbinary(1024)", "not null" => "1", "comment" => "Media URL"],
1430 "media-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the activities uri-id"],
1431 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1432 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1433 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1434 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1435 "size" => ["type" => "bigint unsigned", "comment" => "Media size"],
1436 "blurhash" => ["type" => "varbinary(255)", "comment" => "BlurHash representation of the image"],
1437 "preview" => ["type" => "varbinary(512)", "comment" => "Preview URL"],
1438 "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1439 "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1440 "description" => ["type" => "text", "comment" => ""],
1441 "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1442 "author-url" => ["type" => "varbinary(383)", "comment" => "URL of the author of the media"],
1443 "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1444 "author-image" => ["type" => "varbinary(383)", "comment" => "Image of the author of the media"],
1445 "publisher-url" => ["type" => "varbinary(383)", "comment" => "URL of the publisher of the media"],
1446 "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1447 "publisher-image" => ["type" => "varbinary(383)", "comment" => "Image of the publisher of the media"],
1450 "PRIMARY" => ["id"],
1451 "uri-id-url" => ["UNIQUE", "uri-id", "url(512)"],
1452 "uri-id-id" => ["uri-id", "id"],
1453 "media-uri-id" => ["media-uri-id"],
1456 "post-question" => [
1457 "comment" => "Question",
1459 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1460 "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"],
1461 "multiple" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Multiple choice"],
1462 "voters" => ["type" => "int unsigned", "comment" => "Number of voters for this question"],
1463 "end-time" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Question end time"],
1466 "PRIMARY" => ["id"],
1467 "uri-id" => ["UNIQUE", "uri-id"],
1470 "post-question-option" => [
1471 "comment" => "Question option",
1473 "id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "Id of the question"],
1474 "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"],
1475 "name" => ["type" => "varchar(255)", "comment" => "Name of the option"],
1476 "replies" => ["type" => "int unsigned", "comment" => "Number of replies for this question option"],
1479 "PRIMARY" => ["uri-id", "id"],
1483 "comment" => "post relation to tags",
1485 "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"],
1486 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1487 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1488 "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"],
1491 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1497 "comment" => "Thread related data",
1499 "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"],
1500 "conversation-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the conversation uri"],
1501 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1502 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1503 "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"],
1504 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1505 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1506 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1507 "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"],
1508 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1511 "PRIMARY" => ["uri-id"],
1512 "conversation-id" => ["conversation-id"],
1513 "owner-id" => ["owner-id"],
1514 "author-id" => ["author-id"],
1515 "causer-id" => ["causer-id"],
1516 "received" => ["received"],
1517 "commented" => ["commented"],
1521 "comment" => "User specific post data",
1523 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1524 "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"],
1525 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1526 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1527 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1528 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1529 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1530 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1531 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1532 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1533 "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"],
1534 "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"],
1535 "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"],
1536 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1537 "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1538 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1539 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1540 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1541 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1542 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1543 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1544 "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1545 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1546 "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1547 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1548 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1549 "notification-type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1550 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1551 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1552 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1555 "PRIMARY" => ["id"],
1556 "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1557 "uri-id" => ["uri-id"],
1558 "parent-uri-id" => ["parent-uri-id"],
1559 "thr-parent-id" => ["thr-parent-id"],
1560 "external-id" => ["external-id"],
1561 "owner-id" => ["owner-id"],
1562 "author-id" => ["author-id"],
1563 "causer-id" => ["causer-id"],
1565 "contact-id" => ["contact-id"],
1566 "event-id" => ["event-id"],
1568 "author-id_uid" => ["author-id", "uid"],
1569 "author-id_created" => ["author-id", "created"],
1570 "owner-id_created" => ["owner-id", "created"],
1571 "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1572 "uid_wall_received" => ["uid", "wall", "received"],
1573 "uid_contactid" => ["uid", "contact-id"],
1574 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1575 "uid_unseen" => ["uid", "unseen"],
1576 "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1579 "post-thread-user" => [
1580 "comment" => "Thread related data per user",
1582 "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"],
1583 "conversation-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the conversation uri"],
1584 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1585 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1586 "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"],
1587 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1588 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1589 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1590 "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"],
1591 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1592 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1593 "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
1594 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1595 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1596 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1597 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1598 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1599 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
1600 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1601 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1602 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1603 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1604 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1605 "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1608 "PRIMARY" => ["uid", "uri-id"],
1609 "uri-id" => ["uri-id"],
1610 "conversation-id" => ["conversation-id"],
1611 "owner-id" => ["owner-id"],
1612 "author-id" => ["author-id"],
1613 "causer-id" => ["causer-id"],
1615 "contact-id" => ["contact-id"],
1617 "post-user-id" => ["post-user-id"],
1618 "commented" => ["commented"],
1619 "received" => ["received"],
1620 "author-id_created" => ["author-id", "created"],
1621 "owner-id_created" => ["owner-id", "created"],
1622 "uid_received" => ["uid", "received"],
1623 "uid_wall_received" => ["uid", "wall", "received"],
1624 "uid_commented" => ["uid", "commented"],
1625 "uid_received" => ["uid", "received"],
1626 "uid_created" => ["uid", "created"],
1627 "uid_starred" => ["uid", "starred"],
1628 "uid_mention" => ["uid", "mention"],
1629 "contact-id_commented" => ["contact-id", "commented"],
1630 "contact-id_received" => ["contact-id", "received"],
1631 "contact-id_created" => ["contact-id", "created"],
1634 "post-user-notification" => [
1635 "comment" => "User post notifications",
1637 "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"],
1638 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1639 "notification-type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1642 "PRIMARY" => ["uid", "uri-id"],
1643 "uri-id" => ["uri-id"],
1647 "comment" => "Currently running system processes",
1649 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1650 "hostname" => ["type" => "varchar(255)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
1651 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1652 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1655 "PRIMARY" => ["pid", "hostname"],
1656 "command" => ["command"],
1660 "comment" => "user profiles data",
1662 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1663 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1664 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1665 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1666 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1667 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unused in favor of user.username"],
1668 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1669 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1670 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1671 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1672 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1673 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1674 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1675 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1676 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1677 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1678 "with" => ["type" => "text", "comment" => "Deprecated"],
1679 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1680 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1681 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1682 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1683 "pub_keywords" => ["type" => "text", "comment" => ""],
1684 "prv_keywords" => ["type" => "text", "comment" => ""],
1685 "likes" => ["type" => "text", "comment" => "Deprecated"],
1686 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1687 "about" => ["type" => "text", "comment" => "Profile description"],
1688 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1689 "music" => ["type" => "text", "comment" => "Deprecated"],
1690 "book" => ["type" => "text", "comment" => "Deprecated"],
1691 "tv" => ["type" => "text", "comment" => "Deprecated"],
1692 "film" => ["type" => "text", "comment" => "Deprecated"],
1693 "interest" => ["type" => "text", "comment" => "Deprecated"],
1694 "romance" => ["type" => "text", "comment" => "Deprecated"],
1695 "work" => ["type" => "text", "comment" => "Deprecated"],
1696 "education" => ["type" => "text", "comment" => "Deprecated"],
1697 "contact" => ["type" => "text", "comment" => "Deprecated"],
1698 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1699 "homepage_verified" => ["type" => "boolean", "not null" => 1, "default" => "0", "comment" => "was the homepage verified by a rel-me link back to the profile"],
1700 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
1701 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
1702 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1703 "thumb" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1704 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1705 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1708 "PRIMARY" => ["id"],
1709 "uid_is-default" => ["uid", "is-default"],
1710 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1713 "profile_field" => [
1714 "comment" => "Custom profile fields",
1716 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1717 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1718 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1719 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1720 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1721 "value" => ["type" => "text", "comment" => "Value of the field"],
1722 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1723 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1726 "PRIMARY" => ["id"],
1728 "order" => ["order"],
1732 "push_subscriber" => [
1733 "comment" => "Used for OStatus: Contains feed subscribers",
1735 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1736 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1737 "callback_url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1738 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1739 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1740 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1741 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1742 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1743 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1744 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1747 "PRIMARY" => ["id"],
1748 "next_try" => ["next_try"],
1753 "comment" => "registrations requiring admin approval",
1755 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1756 "hash" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1757 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1758 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1759 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1760 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1761 "note" => ["type" => "text", "comment" => ""],
1764 "PRIMARY" => ["id"],
1771 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1772 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Reporting user"],
1773 "reporter-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Reporting contact"],
1774 "cid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["contact" => "id"], "comment" => "Reported contact"],
1775 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id"], "comment" => "Reported contact server"],
1776 "comment" => ["type" => "text", "comment" => "Report"],
1777 "category-id" => ["type" => "int unsigned", "not null" => 1, "default" => \Friendica\Moderation\Entity\Report::CATEGORY_OTHER, "comment" => "Report category, one of Entity Report::CATEGORY_*"],
1778 "forward" => ["type" => "boolean", "comment" => "Forward the report to the remote server"],
1779 "public-remarks" => ["type" => "text", "comment" => "Remarks shared with the reporter"],
1780 "private-remarks" => ["type" => "text", "comment" => "Remarks shared with the moderation team"],
1781 "last-editor-uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Last editor user"],
1782 "assigned-uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Assigned moderator user"],
1783 "status" => ["type" => "tinyint unsigned", "not null" => "1", "comment" => "Status of the report, one of Entity Report::STATUS_*"],
1784 "resolution" => ["type" => "tinyint unsigned", "comment" => "Resolution of the report, one of Entity Report::RESOLUTION_*"],
1785 "created" => ["type" => "datetime(6)", "not null" => "1", "default" => DBA::NULL_DATETIME6, "comment" => ""],
1786 "edited" => ["type" => "datetime(6)", "comment" => "Last time the report has been edited"],
1789 "PRIMARY" => ["id"],
1792 "reporter-id" => ["reporter-id"],
1794 "last-editor-uid" => ["last-editor-uid"],
1795 "assigned-uid" => ["assigned-uid"],
1796 "status-resolution" => ["status", "resolution"],
1797 "created" => ["created"],
1798 "edited" => ["edited"],
1802 "comment" => "Individual posts attached to a moderation report",
1804 "rid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["report" => "id"], "comment" => "Report id"],
1805 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Uri-id of the reported post"],
1806 "status" => ["type" => "tinyint unsigned", "comment" => "Status of the reported post"],
1809 "PRIMARY" => ["rid", "uri-id"],
1810 "uri-id" => ["uri-id"],
1814 "comment" => "Terms of service rule lines relevant to a moderation report",
1816 "rid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["report" => "id"], "comment" => "Report id"],
1817 "line-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "Terms of service rule line number, may become invalid after a TOS change."],
1818 "text" => ["type" => "text", "not null" => "1", "comment" => "Terms of service rule text recorded at the time of the report"],
1821 "PRIMARY" => ["rid", "line-id"],
1827 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1828 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1829 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1832 "PRIMARY" => ["id"],
1833 "uid_term" => ["uid", "term(64)"],
1834 "term" => ["term(64)"]
1838 "comment" => "web session storage",
1840 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1841 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1842 "data" => ["type" => "text", "comment" => ""],
1843 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1846 "PRIMARY" => ["id"],
1847 "sid" => ["sid(64)"],
1848 "expire" => ["expire"],
1852 "comment" => "Data stored by Database storage backend",
1854 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1855 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1862 "comment" => "Push Subscription for the API",
1864 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1865 "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""],
1866 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1867 "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"],
1868 "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"],
1869 "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"],
1870 "follow" => ["type" => "boolean", "comment" => ""],
1871 "favourite" => ["type" => "boolean", "comment" => ""],
1872 "reblog" => ["type" => "boolean", "comment" => ""],
1873 "mention" => ["type" => "boolean", "comment" => ""],
1874 "poll" => ["type" => "boolean", "comment" => ""],
1875 "follow_request" => ["type" => "boolean", "comment" => ""],
1876 "status" => ["type" => "boolean", "comment" => ""],
1879 "PRIMARY" => ["id"],
1880 "application-id_uid" => ["UNIQUE", "application-id", "uid"],
1881 "uid_application-id" => ["uid", "application-id"],
1884 "check-full-text-search" => [
1885 "comment" => "Check for a full text search match in user defined channels before storing the message in the system",
1887 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1888 "searchtext" => ["type" => "mediumtext", "comment" => "Simplified text for the full text search"],
1891 "PRIMARY" => ["pid"],
1892 "searchtext" => ["FULLTEXT", "searchtext"],
1896 "comment" => "Deleted usernames",
1898 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1899 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1902 "PRIMARY" => ["id"],
1903 "username" => ["username(32)"],
1907 "comment" => "User specific public contact data",
1909 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1910 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1911 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
1912 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1913 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1914 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
1915 "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
1916 "is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"],
1917 "channel-frequency" => ["type" => "tinyint unsigned", "comment" => "Controls the frequency of the appearance of this contact in channels"],
1918 "pending" => ["type" => "boolean", "comment" => ""],
1919 "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
1920 "info" => ["type" => "mediumtext", "comment" => ""],
1921 "notify_new_posts" => ["type" => "boolean", "comment" => ""],
1922 "remote_self" => ["type" => "tinyint unsigned", "comment" => "0 => No mirroring, 1-2 => Mirror as own post, 3 => Mirror as reshare"],
1923 "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => "0 => None, 1 => Fetch information, 3 => Fetch keywords, 2 => Fetch both"],
1924 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
1925 "subhub" => ["type" => "boolean", "comment" => ""],
1926 "hub-verify" => ["type" => "varbinary(383)", "comment" => ""],
1927 "protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
1928 "rating" => ["type" => "tinyint", "comment" => "Automatically detected feed poll frequency"],
1929 "priority" => ["type" => "tinyint unsigned", "comment" => "Feed poll priority"],
1932 "PRIMARY" => ["uid", "cid"],
1934 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
1937 "arrived-activity" => [
1938 "comment" => "Id of arrived activities",
1940 "object-id" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "object id of the incoming activity"],
1941 "received" => ["type" => "datetime", "comment" => "Receiving date"],
1944 "PRIMARY" => ["object-id"],
1946 "engine" => "MEMORY",
1948 "fetched-activity" => [
1949 "comment" => "Id of fetched activities",
1951 "object-id" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "object id of fetched activity"],
1952 "received" => ["type" => "datetime", "comment" => "Receiving date"],
1955 "PRIMARY" => ["object-id"],
1957 "engine" => "MEMORY",
1960 "comment" => "Inter process communication between the frontend and the worker",
1962 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1963 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1966 "PRIMARY" => ["key"],
1968 "engine" => "MEMORY",