3 * @copyright Copyright (C) 2010-2022, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * Main database structure configuration file.
22 * Here are described all the tables, fields and indexes Friendica needs to work.
23 * The entry order is mostly alphabetic - with the exception of tables that are used in foreign keys.
25 * Syntax (braces indicate optionale values):
27 * "comment" => "Description of the table",
30 * "type" => "<field type>{(<field size>)} <unsigned>",
32 * {"extra" => "auto_increment",}
33 * {"default" => "<default value>",}
34 * {"default" => NULL_DATE,} (for datetime fields)
36 * {"foreign|relation" => ["<foreign key table name>" => "<foreign key field name>"],}
37 * "comment" => "Description of the fields"
42 * "PRIMARY" => ["<primary key field name>", ...],
43 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
48 * Whenever possible prefer "foreign" before "relation" with the foreign keys.
49 * "foreign" adds true foreign keys on the database level, while "relation" is just an indicator of a table relation without any consequences
51 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
55 use Friendica\Database\DBA;
57 if (!defined('DB_UPDATE_VERSION')) {
58 define('DB_UPDATE_VERSION', 1486);
64 "comment" => "Global servers",
66 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
67 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
68 "nurl" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
69 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
71 "info" => ["type" => "text", "comment" => ""],
72 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
73 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
74 "active-week-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last week"],
75 "active-month-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last month"],
76 "active-halfyear-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last six month"],
77 "local-posts" => ["type" => "int unsigned", "comment" => "Number of local posts"],
78 "local-comments" => ["type" => "int unsigned", "comment" => "Number of local comments"],
79 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
80 "poco" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
81 "noscrape" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
82 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
83 "protocol" => ["type" => "tinyint unsigned", "comment" => "The protocol of the server"],
84 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
85 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
86 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
87 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
88 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
89 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
90 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last successful connection request"],
91 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Last failed connection request"],
92 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
93 "next_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Next connection request"],
97 "nurl" => ["UNIQUE", "nurl(190)"],
98 "next_contact" => ["next_contact"],
99 "network" => ["network"],
103 "comment" => "The local users",
105 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
106 "parent-uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "The parent user that has full control about this user"],
107 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
108 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
109 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
110 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
111 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
112 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
113 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
114 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
115 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
116 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
117 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
118 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
119 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
120 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
121 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
122 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
123 "spubkey" => ["type" => "text", "comment" => ""],
124 "sprvkey" => ["type" => "text", "comment" => ""],
125 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
126 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
127 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
128 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
129 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
130 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
131 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
132 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
133 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
134 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
135 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
136 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
137 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
138 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
139 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
140 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
141 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
142 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
143 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
144 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
145 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
146 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
147 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
148 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
149 "openidserver" => ["type" => "text", "comment" => ""],
152 "PRIMARY" => ["uid"],
153 "nickname" => ["nickname(32)"],
154 "parent-uid" => ["parent-uid"],
156 "email" => ["email(64)"],
160 "comment" => "URI and GUID for items",
162 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
163 "uri" => ["type" => "varbinary(383)", "not null" => "1", "comment" => "URI of an item"],
164 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
168 "uri" => ["UNIQUE", "uri"],
173 "comment" => "contact table",
175 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
176 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
177 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
178 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
179 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
180 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
181 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
182 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
183 "about" => ["type" => "text", "comment" => ""],
184 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
185 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
186 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
187 "avatar" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
188 "header" => ["type" => "varbinary(383)", "comment" => "Header picture"],
189 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
190 "nurl" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
191 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
192 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
193 "alias" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
194 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
195 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
196 "batch" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
197 "notify" => ["type" => "varbinary(383)", "comment" => ""],
198 "poll" => ["type" => "varbinary(383)", "comment" => ""],
199 "subscribe" => ["type" => "varbinary(383)", "comment" => ""],
200 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
201 "next-update" => ["type" => "datetime", "comment" => "Next connection request"],
202 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
203 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
204 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
205 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
206 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
207 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
208 "local-data" => ["type" => "boolean", "comment" => "Is true when there are posts with this contact on the system"],
209 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
210 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
211 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
212 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Person, organisation, news, community, relay"],
213 "manually-approve" => ["type" => "boolean", "comment" => "Contact requests have to be approved manually"],
214 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
215 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
216 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
217 "baseurl" => ["type" => "varbinary(383)", "default" => "", "comment" => "baseurl of the contact"],
218 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
219 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
220 // User depending fields
221 "reason" => ["type" => "text", "comment" => ""],
222 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
223 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
224 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
225 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
226 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
227 "hub-verify" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
228 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Automatically detected feed poll frequency"],
229 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Feed poll priority"],
230 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
231 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
232 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Contact request is pending"],
233 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
234 "info" => ["type" => "mediumtext", "comment" => ""],
235 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
236 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
237 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
238 // Deprecated, but still in use
239 "photo" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo of the contact"],
240 "thumb" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
241 "micro" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
242 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
243 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
244 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
245 "request" => ["type" => "varbinary(383)", "comment" => ""],
246 "confirm" => ["type" => "varbinary(383)", "comment" => ""],
247 "poco" => ["type" => "varbinary(383)", "comment" => ""],
248 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
249 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead"],
250 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead"],
251 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
252 // Deprecated fields that aren't in use anymore
253 "site-pubkey" => ["type" => "text", "comment" => "Deprecated"],
254 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
255 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
256 "issued-id" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
257 "dfrn-id" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
258 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
259 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
260 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
261 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => "Deprecated"],
262 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
266 "uid_name" => ["uid", "name(190)"],
267 "self_uid" => ["self", "uid"],
268 "alias_uid" => ["alias(128)", "uid"],
269 "pending_uid" => ["pending", "uid"],
270 "blocked_uid" => ["blocked", "uid"],
271 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
272 "uid_network_batch" => ["uid", "network", "batch(64)"],
273 "batch_contact-type" => ["batch(64)", "contact-type"],
274 "addr_uid" => ["addr(128)", "uid"],
275 "nurl_uid" => ["nurl(128)", "uid"],
276 "nick_uid" => ["nick(128)", "uid"],
277 "attag_uid" => ["attag(96)", "uid"],
278 "network_uid_lastupdate" => ["network", "uid", "last-update"],
279 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
280 "next-update" => ["next-update"],
281 "local-data-next-update" => ["local-data", "next-update"],
282 "uid_lastitem" => ["uid", "last-item"],
283 "baseurl" => ["baseurl(64)"],
284 "uid_contact-type" => ["uid", "contact-type"],
285 "uid_self_contact-type" => ["uid", "self", "contact-type"],
286 "self_network_uid" => ["self", "network", "uid"],
287 "gsid_uid_failed" => ["gsid", "uid", "failed"],
288 "uri-id" => ["uri-id"],
292 "comment" => "tags and mentions",
294 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
295 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
296 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
297 "type" => ["type" => "tinyint unsigned", "comment" => "Type of the tag (Unknown, General Collection, Follower Collection or Account)"],
301 "type_name_url" => ["UNIQUE", "name", "url"],
308 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
309 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
310 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
311 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
312 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
313 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
317 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
321 "comment" => "Activity Verbs",
323 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
324 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
332 "2fa_app_specific_password" => [
333 "comment" => "Two-factor app-specific _password",
335 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
336 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
337 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
338 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
339 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
340 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
344 "uid_description" => ["uid", "description(190)"],
347 "2fa_recovery_codes" => [
348 "comment" => "Two-factor authentication recovery codes",
350 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
351 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
352 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
353 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
356 "PRIMARY" => ["uid", "code"]
359 "2fa_trusted_browser" => [
360 "comment" => "Two-factor authentication trusted browsers",
362 "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
363 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
364 "user_agent" => ["type" => "text", "comment" => "User agent string"],
365 "trusted" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Whenever this browser should be trusted or not"],
366 "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
367 "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
370 "PRIMARY" => ["cookie_hash"],
375 "comment" => "Remote and local accounts",
377 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
378 "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"],
379 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
383 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
384 "uid_uri-id" => ["uid", "uri-id"],
388 "comment" => "registered addons",
390 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
391 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
392 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
393 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
394 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
395 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
396 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
400 "installed_name" => ["installed", "name"],
401 "name" => ["UNIQUE", "name"],
405 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
407 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
408 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
409 "uuid" => ["type" => "varbinary(255)", "comment" => ""],
410 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
411 "following" => ["type" => "varbinary(383)", "comment" => ""],
412 "followers" => ["type" => "varbinary(383)", "comment" => ""],
413 "inbox" => ["type" => "varbinary(383)", "not null" => "1", "comment" => ""],
414 "outbox" => ["type" => "varbinary(383)", "comment" => ""],
415 "sharedinbox" => ["type" => "varbinary(383)", "comment" => ""],
416 "featured" => ["type" => "varbinary(383)", "comment" => "Address for the collection of featured posts"],
417 "featured-tags" => ["type" => "varbinary(383)", "comment" => "Address for the collection of featured tags"],
418 "manually-approve" => ["type" => "boolean", "comment" => ""],
419 "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
420 "suspended" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is suspended"],
421 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
422 "name" => ["type" => "varchar(255)", "comment" => ""],
423 "about" => ["type" => "text", "comment" => ""],
424 "xmpp" => ["type" => "varchar(255)", "comment" => "XMPP address"],
425 "matrix" => ["type" => "varchar(255)", "comment" => "Matrix address"],
426 "photo" => ["type" => "varbinary(383)", "comment" => ""],
427 "header" => ["type" => "varbinary(383)", "comment" => "Header picture"],
428 "addr" => ["type" => "varchar(255)", "comment" => ""],
429 "alias" => ["type" => "varbinary(383)", "comment" => ""],
430 "pubkey" => ["type" => "text", "comment" => ""],
431 "subscribe" => ["type" => "varbinary(383)", "comment" => ""],
432 "baseurl" => ["type" => "varbinary(383)", "comment" => "baseurl of the ap contact"],
433 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
434 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
435 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
436 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
437 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
438 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
441 "PRIMARY" => ["url"],
442 "addr" => ["addr(32)"],
443 "alias" => ["alias(190)"],
444 "followers" => ["followers(190)"],
445 "baseurl" => ["baseurl(190)"],
446 "sharedinbox" => ["sharedinbox(190)"],
448 "uri-id" => ["UNIQUE", "uri-id"],
452 "comment" => "OAuth application",
454 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
455 "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
456 "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
457 "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
458 "redirect_uri" => ["type" => "varbinary(383)", "not null" => "1", "comment" => ""],
459 "website" => ["type" => "varbinary(383)", "comment" => ""],
460 "scopes" => ["type" => "varchar(255)", "comment" => ""],
461 "read" => ["type" => "boolean", "comment" => "Read scope"],
462 "write" => ["type" => "boolean", "comment" => "Write scope"],
463 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
464 "push" => ["type" => "boolean", "comment" => "Push scope"],
468 "client_id" => ["UNIQUE", "client_id"]
471 "application-marker" => [
472 "comment" => "Timeline marker",
474 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
475 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
476 "timeline" => ["type" => "varchar(64)", "not null" => "1", "primary" => "1", "comment" => "Marker (home, notifications)"],
477 "last_read_id" => ["type" => "varbinary(383)", "comment" => "Marker id for the timeline"],
478 "version" => ["type" => "smallint unsigned", "comment" => "Version number"],
479 "updated_at" => ["type" => "datetime", "comment" => "creation time"],
482 "PRIMARY" => ["application-id", "uid", "timeline"],
486 "application-token" => [
487 "comment" => "OAuth user token",
489 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
490 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
491 "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
492 "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
493 "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
494 "scopes" => ["type" => "varchar(255)", "comment" => ""],
495 "read" => ["type" => "boolean", "comment" => "Read scope"],
496 "write" => ["type" => "boolean", "comment" => "Write scope"],
497 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
498 "push" => ["type" => "boolean", "comment" => "Push scope"],
501 "PRIMARY" => ["application-id", "uid"],
502 "uid_id" => ["uid", "application-id"],
506 "comment" => "file attachments",
508 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
509 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
510 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
511 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
512 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
513 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
514 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
515 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
516 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
517 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
518 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
519 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
520 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
521 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
522 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
530 "comment" => "Stores temporary data",
532 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
533 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
534 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
535 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
539 "k_expires" => ["k", "expires"],
543 "comment" => "main configuration storage",
545 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
546 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
547 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
548 "v" => ["type" => "mediumtext", "comment" => ""],
552 "cat_k" => ["UNIQUE", "cat", "k"],
555 "contact-relation" => [
556 "comment" => "Contact relations",
558 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
559 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
560 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
561 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
562 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
565 "PRIMARY" => ["cid", "relation-cid"],
566 "relation-cid" => ["relation-cid"],
570 "comment" => "private messages",
572 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
573 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
574 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
575 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
576 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
577 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
578 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
579 "subject" => ["type" => "text", "comment" => "subject of initial message"],
587 "comment" => "Background tasks queue entries",
589 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
590 "command" => ["type" => "varchar(100)", "comment" => "Task command"],
591 "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
592 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
593 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
594 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
595 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
596 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
597 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
598 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
602 "command" => ["command"],
603 "done_command_parameter" => ["done", "command", "parameter(64)"],
604 "done_executed" => ["done", "executed"],
605 "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
606 "done_priority_next_try" => ["done", "priority", "next_try"],
607 "done_pid_next_try" => ["done", "pid", "next_try"],
608 "done_pid_retrial" => ["done", "pid", "retrial"],
609 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
613 "comment" => "Posts that are about to be distributed at a later time",
615 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
616 "uri" => ["type" => "varbinary(383)", "comment" => "URI of the post that will be distributed later"],
617 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
618 "delayed" => ["type" => "datetime", "comment" => "delay time"],
619 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
623 "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
627 "diaspora-interaction" => [
628 "comment" => "Signed Diaspora Interaction",
630 "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"],
631 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
634 "PRIMARY" => ["uri-id"]
638 "comment" => "ActivityPub endpoints - used in the ActivityPub implementation",
640 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
641 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
642 "owner-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
645 "PRIMARY" => ["url"],
646 "owner-uri-id_type" => ["UNIQUE", "owner-uri-id", "type"],
650 "comment" => "Events",
652 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
653 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
654 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
655 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
656 "uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
657 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
658 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
659 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
660 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
661 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
662 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
663 "desc" => ["type" => "text", "comment" => "event description"],
664 "location" => ["type" => "text", "comment" => "event location"],
665 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
666 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
667 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
668 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
669 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
670 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
671 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
675 "uid_start" => ["uid", "start"],
677 "uri-id" => ["uri-id"],
681 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
683 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
684 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
685 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
686 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the fcontact url"],
687 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
688 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
689 "request" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
690 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
691 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
692 "batch" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
693 "notify" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
694 "poll" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
695 "confirm" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
696 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
697 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
698 "alias" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
699 "pubkey" => ["type" => "text", "comment" => ""],
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 interactes 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"],
708 "addr" => ["addr(32)"],
709 "url" => ["UNIQUE", "url(190)"],
710 "uri-id" => ["UNIQUE", "uri-id"],
716 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
717 "url" => ["type" => "varbinary(383)", "comment" => "url that awaiting to be fetched"],
718 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of the fetch request"],
719 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"], ],
722 "url" => ["UNIQUE", "url"],
723 "created" => ["created"],
728 "comment" => "friend suggestion stuff",
730 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
731 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
732 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
733 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
734 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
735 "request" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
736 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
737 "note" => ["type" => "text", "comment" => ""],
738 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
747 "comment" => "privacy groups, group info",
749 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
750 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
751 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
752 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
753 "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."],
754 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
763 "comment" => "privacy groups, member info",
765 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
766 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
767 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
771 "contactid" => ["contact-id"],
772 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
776 "comment" => "Tags that the server has subscribed",
778 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
779 "comment" => "The id of the gserver"],
780 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
783 "PRIMARY" => ["gserver-id", "tag"],
788 "comment" => "addon hook registry",
790 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
791 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
792 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
793 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
794 "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"],
798 "priority" => ["priority"],
799 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
803 "comment" => "Incoming activity",
805 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
806 "activity-id" => ["type" => "varbinary(383)", "comment" => "id of the incoming activity"],
807 "object-id" => ["type" => "varbinary(383)", "comment" => ""],
808 "in-reply-to-id" => ["type" => "varbinary(383)", "comment" => ""],
809 "conversation" => ["type" => "varbinary(383)", "comment" => ""],
810 "type" => ["type" => "varchar(64)", "comment" => "Type of the activity"],
811 "object-type" => ["type" => "varchar(64)", "comment" => "Type of the object activity"],
812 "object-object-type" => ["type" => "varchar(64)", "comment" => "Type of the object's object activity"],
813 "received" => ["type" => "datetime", "comment" => "Receiving date"],
814 "activity" => ["type" => "mediumtext", "comment" => "The JSON activity"],
815 "signer" => ["type" => "varchar(255)", "comment" => ""],
816 "push" => ["type" => "boolean", "comment" => "Is the entry pushed or have pulled it?"],
817 "trust" => ["type" => "boolean", "comment" => "Do we trust this entry?"],
818 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"], ],
821 "activity-id" => ["UNIQUE", "activity-id"],
822 "object-id" => ["object-id"],
823 "received" => ["received"],
827 "inbox-entry-receiver" => [
828 "comment" => "Receiver for the incoming activity",
830 "queue-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["inbox-entry" => "id"], "comment" => ""],
831 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
834 "PRIMARY" => ["queue-id", "uid"],
839 "comment" => "Status of ActivityPub inboxes",
841 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
842 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
843 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
844 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
845 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
846 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
847 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
848 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
851 "PRIMARY" => ["url"],
852 "uri-id" => ["uri-id"],
858 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
859 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
860 "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => "deprecated"],
861 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
862 "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
863 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
864 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
865 "note" => ["type" => "text", "comment" => ""],
866 "hash" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
867 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
868 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
869 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
873 "contact-id" => ["contact-id"],
874 "suggest-cid" => ["suggest-cid"],
881 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
882 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
883 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
884 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
885 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
889 "name_expires" => ["name", "expires"]
893 "comment" => "private messages",
895 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
896 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
897 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
898 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
899 "from-photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
900 "from-url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
901 "contact-id" => ["type" => "varbinary(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
902 "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"],
903 "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
904 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
905 "body" => ["type" => "mediumtext", "comment" => ""],
906 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
907 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
908 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
909 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
910 "uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
911 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
912 "parent-uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
913 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
914 "thr-parent" => ["type" => "varbinary(383)", "comment" => ""],
915 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
916 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
920 "uid_seen" => ["uid", "seen"],
921 "convid" => ["convid"],
922 "uri" => ["uri(64)"],
923 "parent-uri" => ["parent-uri(64)"],
924 "contactid" => ["contact-id(32)"],
925 "author-id" => ["author-id"],
926 "uri-id" => ["uri-id"],
927 "parent-uri-id" => ["parent-uri-id"],
928 "thr-parent-id" => ["thr-parent-id"],
932 "comment" => "Mail account data for fetching mails",
934 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
935 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
936 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
937 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
938 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
939 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
940 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
941 "pass" => ["type" => "text", "comment" => ""],
942 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
943 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
944 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
945 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
946 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
954 "comment" => "table of accounts that can manage each other",
956 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
957 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
958 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
962 "uid_mid" => ["UNIQUE", "uid", "mid"],
967 "comment" => "notifications",
969 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
970 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
971 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
972 "type" => ["type" => "smallint unsigned", "comment" => ""],
973 "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
974 "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
975 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
976 "created" => ["type" => "datetime", "comment" => ""],
977 "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
978 "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
982 "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
984 "actor-id" => ["actor-id"],
985 "target-uri-id" => ["target-uri-id"],
986 "parent-uri-id" => ["parent-uri-id"],
987 "seen_uid" => ["seen", "uid"],
988 "uid_type_parent-uri-id_actor-id" => ["uid", "type", "parent-uri-id", "actor-id"],
992 "comment" => "[Deprecated] User notifications",
994 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
995 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
996 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
997 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
998 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
999 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1000 "msg" => ["type" => "mediumtext", "comment" => ""],
1001 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1002 "link" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1003 "iid" => ["type" => "int unsigned", "comment" => ""],
1004 "parent" => ["type" => "int unsigned", "comment" => ""],
1005 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
1006 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1007 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1008 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
1009 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
1010 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
1011 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
1014 "PRIMARY" => ["id"],
1015 "seen_uid_date" => ["seen", "uid", "date"],
1016 "uid_date" => ["uid", "date"],
1017 "uid_type_link" => ["uid", "type", "link(190)"],
1018 "uri-id" => ["uri-id"],
1019 "parent-uri-id" => ["parent-uri-id"],
1022 "notify-threads" => [
1025 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1026 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
1027 "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
1028 "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1029 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1030 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
1031 "comment" => "User id"],
1034 "PRIMARY" => ["id"],
1035 "master-parent-uri-id" => ["master-parent-uri-id"],
1036 "receiver-uid" => ["receiver-uid"],
1037 "notify-id" => ["notify-id"],
1041 "comment" => "cache for OEmbed queries",
1043 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1044 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
1045 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
1046 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1049 "PRIMARY" => ["url", "maxwidth"],
1050 "created" => ["created"],
1053 "openwebauth-token" => [
1054 "comment" => "Store OpenWebAuth token to verify contacts",
1056 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1057 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
1058 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1059 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1060 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1061 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1064 "PRIMARY" => ["id"],
1069 "comment" => "cache for 'parse_url' queries",
1071 "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
1072 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1073 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1074 "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
1075 "content" => ["type" => "mediumtext", "comment" => "page data"],
1076 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1077 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
1080 "PRIMARY" => ["url_hash", "guessing", "oembed"],
1081 "created" => ["created"],
1082 "expires" => ["expires"],
1086 "comment" => "personal (per user) configuration storage",
1088 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
1089 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1090 "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
1091 "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1092 "v" => ["type" => "mediumtext", "comment" => "Value"],
1095 "PRIMARY" => ["id"],
1096 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1100 "comment" => "photo storage",
1102 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1103 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1104 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1105 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1106 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1107 "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1108 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1109 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1110 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1111 "desc" => ["type" => "text", "comment" => ""],
1112 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1113 "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
1114 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1115 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1116 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1117 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1118 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1119 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1120 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1121 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1122 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1123 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1124 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1125 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1126 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1127 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1128 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1129 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1132 "PRIMARY" => ["id"],
1133 "contactid" => ["contact-id"],
1134 "uid_contactid" => ["uid", "contact-id"],
1135 "uid_profile" => ["uid", "profile"],
1136 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1137 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1138 "resource-id" => ["resource-id"],
1139 "uid_photo-type" => ["uid", "photo-type"],
1143 "comment" => "Structure for all posts",
1145 "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"],
1146 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1147 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1148 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1149 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1150 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1151 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1152 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1153 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1154 "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"],
1155 "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"],
1156 "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"],
1157 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1158 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1159 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1160 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1161 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1162 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1165 "PRIMARY" => ["uri-id"],
1166 "parent-uri-id" => ["parent-uri-id"],
1167 "thr-parent-id" => ["thr-parent-id"],
1168 "external-id" => ["external-id"],
1169 "owner-id" => ["owner-id"],
1170 "author-id" => ["author-id"],
1171 "causer-id" => ["causer-id"],
1175 "post-activity" => [
1176 "comment" => "Original remote activity",
1178 "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"],
1179 "activity" => ["type" => "mediumtext", "comment" => "Original activity"],
1180 "received" => ["type" => "datetime", "comment" => ""],
1183 "PRIMARY" => ["uri-id"],
1186 "post-category" => [
1187 "comment" => "post relation to categories",
1189 "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"],
1190 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1191 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1192 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1195 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1197 "uid_uri-id" => ["uid", "uri-id"],
1200 "post-collection" => [
1201 "comment" => "Collection of posts",
1203 "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"],
1204 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "0 - Featured"],
1205 "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Author of the featured post"],
1208 "PRIMARY" => ["uri-id", "type"],
1210 "author-id" => ["author-id"],
1214 "comment" => "Content for all posts",
1216 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1217 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1218 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1219 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1220 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1221 "quote-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the quoted uri"],
1222 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1223 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1224 "language" => ["type" => "text", "comment" => "Language information about this post"],
1225 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1226 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1227 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1228 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1229 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1230 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1231 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1232 "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"],
1233 "plink" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1236 "PRIMARY" => ["uri-id"],
1237 "plink" => ["plink(191)"],
1238 "resource-id" => ["resource-id"],
1239 "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1240 "quote-uri-id" => ["quote-uri-id"],
1243 "post-delivery" => [
1244 "comment" => "Delivery data for posts for the batch processing",
1246 "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"],
1247 "inbox-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
1248 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Delivering user"],
1249 "created" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
1250 "command" => ["type" => "varbinary(32)", "comment" => ""],
1251 "failed" => ["type" => "tinyint", "default" => 0, "comment" => "Number of times the delivery has failed"],
1252 "receivers" => ["type" => "mediumtext", "comment" => "JSON encoded array with the receiving contacts"],
1255 "PRIMARY" => ["uri-id", "inbox-id"],
1256 "inbox-id_created" => ["inbox-id", "created"],
1260 "post-delivery-data" => [
1261 "comment" => "Delivery data for items",
1263 "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"],
1264 "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"],
1265 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1266 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1267 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1268 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1269 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1270 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1271 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1272 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1273 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1276 "PRIMARY" => ["uri-id"],
1280 "comment" => "Post history",
1282 "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"],
1283 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "primary" => "1", "comment" => "Date of edit"],
1284 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1285 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1286 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1287 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1288 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1289 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1290 "language" => ["type" => "text", "comment" => "Language information about this post"],
1291 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1292 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1293 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1294 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1295 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1296 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1297 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1298 "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"],
1299 "plink" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1302 "PRIMARY" => ["uri-id", "edited"],
1306 "comment" => "Post related external links",
1308 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1309 "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"],
1310 "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
1311 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1314 "PRIMARY" => ["id"],
1315 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1319 "comment" => "Attached media",
1321 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1322 "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"],
1323 "url" => ["type" => "varbinary(1024)", "not null" => "1", "comment" => "Media URL"],
1324 "media-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the activities uri-id"],
1325 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1326 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1327 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1328 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1329 "size" => ["type" => "bigint unsigned", "comment" => "Media size"],
1330 "preview" => ["type" => "varbinary(512)", "comment" => "Preview URL"],
1331 "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1332 "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1333 "description" => ["type" => "text", "comment" => ""],
1334 "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1335 "author-url" => ["type" => "varbinary(383)", "comment" => "URL of the author of the media"],
1336 "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1337 "author-image" => ["type" => "varbinary(383)", "comment" => "Image of the author of the media"],
1338 "publisher-url" => ["type" => "varbinary(383)", "comment" => "URL of the publisher of the media"],
1339 "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1340 "publisher-image" => ["type" => "varbinary(383)", "comment" => "Image of the publisher of the media"],
1343 "PRIMARY" => ["id"],
1344 "uri-id-url" => ["UNIQUE", "uri-id", "url(512)"],
1345 "uri-id-id" => ["uri-id", "id"],
1346 "media-uri-id" => ["media-uri-id"],
1349 "post-question" => [
1350 "comment" => "Question",
1352 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1353 "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"],
1354 "multiple" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Multiple choice"],
1355 "voters" => ["type" => "int unsigned", "comment" => "Number of voters for this question"],
1356 "end-time" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Question end time"],
1359 "PRIMARY" => ["id"],
1360 "uri-id" => ["UNIQUE", "uri-id"],
1363 "post-question-option" => [
1364 "comment" => "Question option",
1366 "id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "Id of the question"],
1367 "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"],
1368 "name" => ["type" => "varchar(255)", "comment" => "Name of the option"],
1369 "replies" => ["type" => "int unsigned", "comment" => "Number of replies for this question option"],
1372 "PRIMARY" => ["uri-id", "id"],
1376 "comment" => "post relation to tags",
1378 "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"],
1379 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1380 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1381 "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"],
1384 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1390 "comment" => "Thread related data",
1392 "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"],
1393 "conversation-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the conversation uri"],
1394 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1395 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1396 "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"],
1397 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1398 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1399 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1400 "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"],
1401 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1404 "PRIMARY" => ["uri-id"],
1405 "conversation-id" => ["conversation-id"],
1406 "owner-id" => ["owner-id"],
1407 "author-id" => ["author-id"],
1408 "causer-id" => ["causer-id"],
1409 "received" => ["received"],
1410 "commented" => ["commented"],
1414 "comment" => "User specific post data",
1416 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1417 "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"],
1418 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1419 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1420 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1421 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1422 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1423 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1424 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1425 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1426 "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"],
1427 "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"],
1428 "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"],
1429 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1430 "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1431 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1432 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1433 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1434 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1435 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1436 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1437 "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1438 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1439 "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1440 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1441 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1442 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1443 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1444 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1445 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1448 "PRIMARY" => ["id"],
1449 "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1450 "uri-id" => ["uri-id"],
1451 "parent-uri-id" => ["parent-uri-id"],
1452 "thr-parent-id" => ["thr-parent-id"],
1453 "external-id" => ["external-id"],
1454 "owner-id" => ["owner-id"],
1455 "author-id" => ["author-id"],
1456 "causer-id" => ["causer-id"],
1458 "contact-id" => ["contact-id"],
1459 "event-id" => ["event-id"],
1461 "author-id_uid" => ["author-id", "uid"],
1462 "author-id_received" => ["author-id", "received"],
1463 "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1464 "uid_wall_received" => ["uid", "wall", "received"],
1465 "uid_contactid" => ["uid", "contact-id"],
1466 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1467 "uid_unseen" => ["uid", "unseen"],
1468 "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1471 "post-thread-user" => [
1472 "comment" => "Thread related data per user",
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 "conversation-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the conversation uri"],
1476 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1477 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1478 "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"],
1479 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1480 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1481 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1482 "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"],
1483 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1484 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1485 "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
1486 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1487 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1488 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1489 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1490 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1491 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
1492 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1493 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1494 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1495 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1496 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1497 "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1500 "PRIMARY" => ["uid", "uri-id"],
1501 "uri-id" => ["uri-id"],
1502 "conversation-id" => ["conversation-id"],
1503 "owner-id" => ["owner-id"],
1504 "author-id" => ["author-id"],
1505 "causer-id" => ["causer-id"],
1507 "contact-id" => ["contact-id"],
1509 "post-user-id" => ["post-user-id"],
1510 "commented" => ["commented"],
1511 "uid_received" => ["uid", "received"],
1512 "uid_wall_received" => ["uid", "wall", "received"],
1513 "uid_commented" => ["uid", "commented"],
1514 "uid_starred" => ["uid", "starred"],
1515 "uid_mention" => ["uid", "mention"],
1518 "post-user-notification" => [
1519 "comment" => "User post notifications",
1521 "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"],
1522 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1523 "notification-type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1526 "PRIMARY" => ["uid", "uri-id"],
1527 "uri-id" => ["uri-id"],
1531 "comment" => "Currently running system processes",
1533 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1534 "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
1535 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1536 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1539 "PRIMARY" => ["pid", "hostname"],
1540 "command" => ["command"],
1544 "comment" => "user profiles data",
1546 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1547 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1548 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1549 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1550 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1551 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1552 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1553 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1554 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1555 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1556 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1557 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1558 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1559 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1560 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1561 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1562 "with" => ["type" => "text", "comment" => "Deprecated"],
1563 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1564 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1565 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1566 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1567 "pub_keywords" => ["type" => "text", "comment" => ""],
1568 "prv_keywords" => ["type" => "text", "comment" => ""],
1569 "likes" => ["type" => "text", "comment" => "Deprecated"],
1570 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1571 "about" => ["type" => "text", "comment" => "Profile description"],
1572 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1573 "music" => ["type" => "text", "comment" => "Deprecated"],
1574 "book" => ["type" => "text", "comment" => "Deprecated"],
1575 "tv" => ["type" => "text", "comment" => "Deprecated"],
1576 "film" => ["type" => "text", "comment" => "Deprecated"],
1577 "interest" => ["type" => "text", "comment" => "Deprecated"],
1578 "romance" => ["type" => "text", "comment" => "Deprecated"],
1579 "work" => ["type" => "text", "comment" => "Deprecated"],
1580 "education" => ["type" => "text", "comment" => "Deprecated"],
1581 "contact" => ["type" => "text", "comment" => "Deprecated"],
1582 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1583 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
1584 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
1585 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1586 "thumb" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1587 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1588 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1591 "PRIMARY" => ["id"],
1592 "uid_is-default" => ["uid", "is-default"],
1593 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1596 "profile_field" => [
1597 "comment" => "Custom profile fields",
1599 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1600 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1601 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1602 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1603 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1604 "value" => ["type" => "text", "comment" => "Value of the field"],
1605 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1606 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1609 "PRIMARY" => ["id"],
1611 "order" => ["order"],
1615 "push_subscriber" => [
1616 "comment" => "Used for OStatus: Contains feed subscribers",
1618 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1619 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1620 "callback_url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1621 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1622 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1623 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1624 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1625 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1626 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1627 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1630 "PRIMARY" => ["id"],
1631 "next_try" => ["next_try"],
1636 "comment" => "registrations requiring admin approval",
1638 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1639 "hash" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1640 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1641 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1642 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1643 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1644 "note" => ["type" => "text", "comment" => ""],
1647 "PRIMARY" => ["id"],
1654 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1655 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1656 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1659 "PRIMARY" => ["id"],
1660 "uid_term" => ["uid", "term(64)"],
1661 "term" => ["term(64)"]
1665 "comment" => "web session storage",
1667 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1668 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1669 "data" => ["type" => "text", "comment" => ""],
1670 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1673 "PRIMARY" => ["id"],
1674 "sid" => ["sid(64)"],
1675 "expire" => ["expire"],
1679 "comment" => "Data stored by Database storage backend",
1681 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1682 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1689 "comment" => "Push Subscription for the API",
1691 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1692 "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""],
1693 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1694 "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"],
1695 "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"],
1696 "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"],
1697 "follow" => ["type" => "boolean", "comment" => ""],
1698 "favourite" => ["type" => "boolean", "comment" => ""],
1699 "reblog" => ["type" => "boolean", "comment" => ""],
1700 "mention" => ["type" => "boolean", "comment" => ""],
1701 "poll" => ["type" => "boolean", "comment" => ""],
1702 "follow_request" => ["type" => "boolean", "comment" => ""],
1703 "status" => ["type" => "boolean", "comment" => ""],
1706 "PRIMARY" => ["id"],
1707 "application-id_uid" => ["UNIQUE", "application-id", "uid"],
1708 "uid_application-id" => ["uid", "application-id"],
1712 "comment" => "Deleted usernames",
1714 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1715 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1718 "PRIMARY" => ["id"],
1719 "username" => ["username(32)"],
1723 "comment" => "User specific public contact data",
1725 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1726 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1727 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
1728 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1729 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1730 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
1731 "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
1732 "is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"],
1733 "pending" => ["type" => "boolean", "comment" => ""],
1734 "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
1735 "info" => ["type" => "mediumtext", "comment" => ""],
1736 "notify_new_posts" => ["type" => "boolean", "comment" => ""],
1737 "remote_self" => ["type" => "boolean", "comment" => ""],
1738 "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => ""],
1739 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
1740 "subhub" => ["type" => "boolean", "comment" => ""],
1741 "hub-verify" => ["type" => "varbinary(383)", "comment" => ""],
1742 "protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
1743 "rating" => ["type" => "tinyint", "comment" => "Automatically detected feed poll frequency"],
1744 "priority" => ["type" => "tinyint unsigned", "comment" => "Feed poll priority"],
1747 "PRIMARY" => ["uid", "cid"],
1749 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
1752 "arrived-activity" => [
1753 "comment" => "Id of arrived activities",
1755 "object-id" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "object id of the incoming activity"],
1756 "received" => ["type" => "datetime", "comment" => "Receiving date"],
1759 "PRIMARY" => ["object-id"],
1761 "engine" => "MEMORY",
1763 "fetched-activity" => [
1764 "comment" => "Id of fetched activities",
1766 "object-id" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "object id of fetched activity"],
1767 "received" => ["type" => "datetime", "comment" => "Receiving date"],
1770 "PRIMARY" => ["object-id"],
1772 "engine" => "MEMORY",
1775 "comment" => "Inter process communication between the frontend and the worker",
1777 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1778 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1781 "PRIMARY" => ["key"],
1783 "engine" => "MEMORY",