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', 1496);
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 "last-activity" => ["type" => "date", "comment" => "Day of the last activity"],
119 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
120 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
121 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
122 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
123 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
124 "spubkey" => ["type" => "text", "comment" => ""],
125 "sprvkey" => ["type" => "text", "comment" => ""],
126 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
127 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
128 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
129 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
130 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
131 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
132 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
133 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
134 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
135 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
136 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
137 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
138 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
139 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
140 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Delay in days before deleting user-related posts. Scope is controlled by pConfig."],
141 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
142 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
143 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
144 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
145 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
146 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
147 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
148 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
149 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
150 "openidserver" => ["type" => "text", "comment" => ""],
153 "PRIMARY" => ["uid"],
154 "nickname" => ["nickname(32)"],
155 "parent-uid" => ["parent-uid"],
157 "email" => ["email(64)"],
161 "comment" => "URI and GUID for items",
163 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
164 "uri" => ["type" => "varbinary(383)", "not null" => "1", "comment" => "URI of an item"],
165 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
169 "uri" => ["UNIQUE", "uri"],
174 "comment" => "contact table",
176 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
177 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
178 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
179 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
180 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
181 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
182 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
183 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
184 "about" => ["type" => "text", "comment" => ""],
185 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
186 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
187 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
188 "avatar" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
189 "header" => ["type" => "varbinary(383)", "comment" => "Header picture"],
190 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
191 "nurl" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
192 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
193 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
194 "alias" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
195 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
196 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
197 "batch" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
198 "notify" => ["type" => "varbinary(383)", "comment" => ""],
199 "poll" => ["type" => "varbinary(383)", "comment" => ""],
200 "subscribe" => ["type" => "varbinary(383)", "comment" => ""],
201 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
202 "next-update" => ["type" => "datetime", "comment" => "Next connection request"],
203 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
204 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
205 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
206 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
207 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
208 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
209 "local-data" => ["type" => "boolean", "comment" => "Is true when there are posts with this contact on the system"],
210 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
211 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
212 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
213 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Person, organisation, news, community, relay"],
214 "manually-approve" => ["type" => "boolean", "comment" => "Contact requests have to be approved manually"],
215 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
216 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
217 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
218 "baseurl" => ["type" => "varbinary(383)", "default" => "", "comment" => "baseurl of the contact"],
219 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
220 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
221 // User depending fields
222 "reason" => ["type" => "text", "comment" => ""],
223 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
224 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
225 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
226 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
227 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
228 "hub-verify" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
229 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Automatically detected feed poll frequency"],
230 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Feed poll priority"],
231 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
232 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
233 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Contact request is pending"],
234 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
235 "info" => ["type" => "mediumtext", "comment" => ""],
236 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
237 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
238 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
239 // Deprecated, but still in use
240 "photo" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo of the contact"],
241 "thumb" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
242 "micro" => ["type" => "varbinary(383)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
243 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
244 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
245 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
246 "request" => ["type" => "varbinary(383)", "comment" => ""],
247 "confirm" => ["type" => "varbinary(383)", "comment" => ""],
248 "poco" => ["type" => "varbinary(383)", "comment" => ""],
249 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
250 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = false instead"],
251 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group. Deprecated, use 'contact-type' = 'community' and 'manually-approve' = true instead"],
252 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
253 // Deprecated fields that aren't in use anymore
254 "site-pubkey" => ["type" => "text", "comment" => "Deprecated"],
255 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
256 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
257 "issued-id" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
258 "dfrn-id" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
259 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
260 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
261 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
262 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => "Deprecated"],
263 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
267 "uid_name" => ["uid", "name(190)"],
268 "self_uid" => ["self", "uid"],
269 "alias_uid" => ["alias(128)", "uid"],
270 "pending_uid" => ["pending", "uid"],
271 "blocked_uid" => ["blocked", "uid"],
272 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
273 "uid_network_batch" => ["uid", "network", "batch(64)"],
274 "batch_contact-type" => ["batch(64)", "contact-type"],
275 "addr_uid" => ["addr(128)", "uid"],
276 "nurl_uid" => ["nurl(128)", "uid"],
277 "nick_uid" => ["nick(128)", "uid"],
278 "attag_uid" => ["attag(96)", "uid"],
279 "network_uid_lastupdate" => ["network", "uid", "last-update"],
280 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
281 "next-update" => ["next-update"],
282 "local-data-next-update" => ["local-data", "next-update"],
283 "uid_lastitem" => ["uid", "last-item"],
284 "baseurl" => ["baseurl(64)"],
285 "uid_contact-type" => ["uid", "contact-type"],
286 "uid_self_contact-type" => ["uid", "self", "contact-type"],
287 "self_network_uid" => ["self", "network", "uid"],
288 "gsid_uid_failed" => ["gsid", "uid", "failed"],
289 "uri-id" => ["uri-id"],
293 "comment" => "tags and mentions",
295 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
296 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
297 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
298 "type" => ["type" => "tinyint unsigned", "comment" => "Type of the tag (Unknown, General Collection, Follower Collection or Account)"],
302 "type_name_url" => ["UNIQUE", "name", "url"],
309 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
310 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
311 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
312 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
313 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
314 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
318 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
322 "comment" => "Activity Verbs",
324 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
325 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
333 "2fa_app_specific_password" => [
334 "comment" => "Two-factor app-specific _password",
336 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
337 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
338 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
339 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
340 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
341 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
345 "uid_description" => ["uid", "description(190)"],
348 "2fa_recovery_codes" => [
349 "comment" => "Two-factor authentication recovery codes",
351 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
352 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
353 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
354 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
357 "PRIMARY" => ["uid", "code"]
360 "2fa_trusted_browser" => [
361 "comment" => "Two-factor authentication trusted browsers",
363 "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
364 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
365 "user_agent" => ["type" => "text", "comment" => "User agent string"],
366 "trusted" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Whenever this browser should be trusted or not"],
367 "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
368 "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
371 "PRIMARY" => ["cookie_hash"],
375 "account-suggestion" => [
376 "comment" => "Account suggestion",
378 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the account url"],
379 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
380 "level" => ["type" => "smallint unsigned", "comment" => "level of closeness"],
381 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "If set, this account will not be suggested again"], ],
383 "PRIMARY" => ["uid", "uri-id"],
384 "uri-id_uid" => ["uri-id", "uid"],
388 "comment" => "Remote and local accounts",
390 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
391 "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"],
392 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
396 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
397 "uid_uri-id" => ["uid", "uri-id"],
401 "comment" => "registered addons",
403 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
404 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
405 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
406 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
407 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
408 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
409 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
413 "installed_name" => ["installed", "name"],
414 "name" => ["UNIQUE", "name"],
418 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
420 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
421 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
422 "uuid" => ["type" => "varbinary(255)", "comment" => ""],
423 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
424 "following" => ["type" => "varbinary(383)", "comment" => ""],
425 "followers" => ["type" => "varbinary(383)", "comment" => ""],
426 "inbox" => ["type" => "varbinary(383)", "not null" => "1", "comment" => ""],
427 "outbox" => ["type" => "varbinary(383)", "comment" => ""],
428 "sharedinbox" => ["type" => "varbinary(383)", "comment" => ""],
429 "featured" => ["type" => "varbinary(383)", "comment" => "Address for the collection of featured posts"],
430 "featured-tags" => ["type" => "varbinary(383)", "comment" => "Address for the collection of featured tags"],
431 "manually-approve" => ["type" => "boolean", "comment" => ""],
432 "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
433 "suspended" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is suspended"],
434 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
435 "name" => ["type" => "varchar(255)", "comment" => ""],
436 "about" => ["type" => "text", "comment" => ""],
437 "xmpp" => ["type" => "varchar(255)", "comment" => "XMPP address"],
438 "matrix" => ["type" => "varchar(255)", "comment" => "Matrix address"],
439 "photo" => ["type" => "varbinary(383)", "comment" => ""],
440 "header" => ["type" => "varbinary(383)", "comment" => "Header picture"],
441 "addr" => ["type" => "varchar(255)", "comment" => ""],
442 "alias" => ["type" => "varbinary(383)", "comment" => ""],
443 "pubkey" => ["type" => "text", "comment" => ""],
444 "subscribe" => ["type" => "varbinary(383)", "comment" => ""],
445 "baseurl" => ["type" => "varbinary(383)", "comment" => "baseurl of the ap contact"],
446 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
447 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
448 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
449 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
450 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
451 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
454 "PRIMARY" => ["url"],
455 "addr" => ["addr(32)"],
456 "alias" => ["alias(190)"],
457 "followers" => ["followers(190)"],
458 "baseurl" => ["baseurl(190)"],
459 "sharedinbox" => ["sharedinbox(190)"],
461 "uri-id" => ["UNIQUE", "uri-id"],
465 "comment" => "OAuth application",
467 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
468 "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
469 "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
470 "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
471 "redirect_uri" => ["type" => "varbinary(383)", "not null" => "1", "comment" => ""],
472 "website" => ["type" => "varbinary(383)", "comment" => ""],
473 "scopes" => ["type" => "varchar(255)", "comment" => ""],
474 "read" => ["type" => "boolean", "comment" => "Read scope"],
475 "write" => ["type" => "boolean", "comment" => "Write scope"],
476 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
477 "push" => ["type" => "boolean", "comment" => "Push scope"],
481 "client_id" => ["UNIQUE", "client_id"]
484 "application-marker" => [
485 "comment" => "Timeline marker",
487 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
488 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
489 "timeline" => ["type" => "varchar(64)", "not null" => "1", "primary" => "1", "comment" => "Marker (home, notifications)"],
490 "last_read_id" => ["type" => "varbinary(383)", "comment" => "Marker id for the timeline"],
491 "version" => ["type" => "smallint unsigned", "comment" => "Version number"],
492 "updated_at" => ["type" => "datetime", "comment" => "creation time"],
495 "PRIMARY" => ["application-id", "uid", "timeline"],
499 "application-token" => [
500 "comment" => "OAuth user token",
502 "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
503 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
504 "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
505 "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
506 "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
507 "scopes" => ["type" => "varchar(255)", "comment" => ""],
508 "read" => ["type" => "boolean", "comment" => "Read scope"],
509 "write" => ["type" => "boolean", "comment" => "Write scope"],
510 "follow" => ["type" => "boolean", "comment" => "Follow scope"],
511 "push" => ["type" => "boolean", "comment" => "Push scope"],
514 "PRIMARY" => ["application-id", "uid"],
515 "uid_id" => ["uid", "application-id"],
519 "comment" => "file attachments",
521 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
522 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
523 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
524 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
525 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
526 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
527 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
528 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
529 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
530 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
531 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
532 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
533 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
534 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
535 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
543 "comment" => "Stores temporary data",
545 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
546 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
547 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
548 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
552 "k_expires" => ["k", "expires"],
556 "comment" => "main configuration storage",
558 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
559 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
560 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
561 "v" => ["type" => "mediumtext", "comment" => ""],
565 "cat_k" => ["UNIQUE", "cat", "k"],
568 "contact-relation" => [
569 "comment" => "Contact relations",
571 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
572 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
573 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
574 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
575 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
578 "PRIMARY" => ["cid", "relation-cid"],
579 "relation-cid" => ["relation-cid"],
583 "comment" => "private messages",
585 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
586 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
587 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
588 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
589 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
590 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
591 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
592 "subject" => ["type" => "text", "comment" => "subject of initial message"],
600 "comment" => "Background tasks queue entries",
602 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
603 "command" => ["type" => "varchar(100)", "comment" => "Task command"],
604 "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
605 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
606 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
607 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
608 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
609 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
610 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
611 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
615 "command" => ["command"],
616 "done_command_parameter" => ["done", "command", "parameter(64)"],
617 "done_executed" => ["done", "executed"],
618 "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
619 "done_priority_next_try" => ["done", "priority", "next_try"],
620 "done_pid_next_try" => ["done", "pid", "next_try"],
621 "done_pid_retrial" => ["done", "pid", "retrial"],
622 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
626 "comment" => "Posts that are about to be distributed at a later time",
628 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
629 "uri" => ["type" => "varbinary(383)", "comment" => "URI of the post that will be distributed later"],
630 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
631 "delayed" => ["type" => "datetime", "comment" => "delay time"],
632 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
636 "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
640 "diaspora-interaction" => [
641 "comment" => "Signed Diaspora Interaction",
643 "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"],
644 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
647 "PRIMARY" => ["uri-id"]
651 "comment" => "ActivityPub endpoints - used in the ActivityPub implementation",
653 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
654 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
655 "owner-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
658 "PRIMARY" => ["url"],
659 "owner-uri-id_type" => ["UNIQUE", "owner-uri-id", "type"],
663 "comment" => "Events",
665 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
666 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
667 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
668 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
669 "uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
670 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
671 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
672 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
673 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
674 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
675 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
676 "desc" => ["type" => "text", "comment" => "event description"],
677 "location" => ["type" => "text", "comment" => "event location"],
678 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
679 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
680 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
681 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
682 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
683 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
684 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
688 "uid_start" => ["uid", "start"],
690 "uri-id" => ["uri-id"],
694 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
696 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
697 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
698 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
699 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the fcontact url"],
700 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
701 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
702 "request" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
703 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
704 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
705 "batch" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
706 "notify" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
707 "poll" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
708 "confirm" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
709 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
710 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
711 "alias" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
712 "pubkey" => ["type" => "text", "comment" => ""],
713 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
714 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
715 "interacting_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts this contact interactes with"],
716 "interacted_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts that interacted with this contact"],
717 "post_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts and comments"],
721 "addr" => ["addr(32)"],
722 "url" => ["UNIQUE", "url(190)"],
723 "uri-id" => ["UNIQUE", "uri-id"],
729 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
730 "url" => ["type" => "varbinary(383)", "comment" => "url that awaiting to be fetched"],
731 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of the fetch request"],
732 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"], ],
735 "url" => ["UNIQUE", "url"],
736 "created" => ["created"],
741 "comment" => "friend suggestion stuff",
743 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
744 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
745 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
746 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
747 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
748 "request" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
749 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
750 "note" => ["type" => "text", "comment" => ""],
751 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
760 "comment" => "privacy groups, group info",
762 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
763 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
764 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
765 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
766 "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."],
767 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
776 "comment" => "privacy groups, member info",
778 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
779 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
780 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
784 "contactid" => ["contact-id"],
785 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
789 "comment" => "Tags that the server has subscribed",
791 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
792 "comment" => "The id of the gserver"],
793 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
796 "PRIMARY" => ["gserver-id", "tag"],
801 "comment" => "addon hook registry",
803 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
804 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
805 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
806 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
807 "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"],
811 "priority" => ["priority"],
812 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
816 "comment" => "Incoming activity",
818 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
819 "activity-id" => ["type" => "varbinary(383)", "comment" => "id of the incoming activity"],
820 "object-id" => ["type" => "varbinary(383)", "comment" => ""],
821 "in-reply-to-id" => ["type" => "varbinary(383)", "comment" => ""],
822 "conversation" => ["type" => "varbinary(383)", "comment" => ""],
823 "type" => ["type" => "varchar(64)", "comment" => "Type of the activity"],
824 "object-type" => ["type" => "varchar(64)", "comment" => "Type of the object activity"],
825 "object-object-type" => ["type" => "varchar(64)", "comment" => "Type of the object's object activity"],
826 "received" => ["type" => "datetime", "comment" => "Receiving date"],
827 "activity" => ["type" => "mediumtext", "comment" => "The JSON activity"],
828 "signer" => ["type" => "varchar(255)", "comment" => ""],
829 "push" => ["type" => "boolean", "comment" => "Is the entry pushed or have pulled it?"],
830 "trust" => ["type" => "boolean", "comment" => "Do we trust this entry?"],
831 "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"], ],
834 "activity-id" => ["UNIQUE", "activity-id"],
835 "object-id" => ["object-id"],
836 "received" => ["received"],
840 "inbox-entry-receiver" => [
841 "comment" => "Receiver for the incoming activity",
843 "queue-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["inbox-entry" => "id"], "comment" => ""],
844 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
847 "PRIMARY" => ["queue-id", "uid"],
852 "comment" => "Status of ActivityPub inboxes",
854 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
855 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
856 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
857 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
858 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
859 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
860 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
861 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
864 "PRIMARY" => ["url"],
865 "uri-id" => ["uri-id"],
871 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
872 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
873 "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => "deprecated"],
874 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
875 "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
876 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
877 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
878 "note" => ["type" => "text", "comment" => ""],
879 "hash" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
880 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
881 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
882 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
886 "contact-id" => ["contact-id"],
887 "suggest-cid" => ["suggest-cid"],
894 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
895 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
896 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
897 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
898 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
902 "name_expires" => ["name", "expires"]
906 "comment" => "private messages",
908 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
909 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
910 "guid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
911 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
912 "from-photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
913 "from-url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
914 "contact-id" => ["type" => "varbinary(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
915 "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"],
916 "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
917 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
918 "body" => ["type" => "mediumtext", "comment" => ""],
919 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
920 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
921 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
922 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
923 "uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
924 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
925 "parent-uri" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
926 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
927 "thr-parent" => ["type" => "varbinary(383)", "comment" => ""],
928 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
929 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
933 "uid_seen" => ["uid", "seen"],
934 "convid" => ["convid"],
935 "uri" => ["uri(64)"],
936 "parent-uri" => ["parent-uri(64)"],
937 "contactid" => ["contact-id(32)"],
938 "author-id" => ["author-id"],
939 "uri-id" => ["uri-id"],
940 "parent-uri-id" => ["parent-uri-id"],
941 "thr-parent-id" => ["thr-parent-id"],
945 "comment" => "Mail account data for fetching mails",
947 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
948 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
949 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
950 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
951 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
952 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
953 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
954 "pass" => ["type" => "text", "comment" => ""],
955 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
956 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
957 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
958 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
959 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
967 "comment" => "table of accounts that can manage each other",
969 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
970 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
971 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
975 "uid_mid" => ["UNIQUE", "uid", "mid"],
980 "comment" => "notifications",
982 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
983 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
984 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
985 "type" => ["type" => "smallint unsigned", "comment" => ""],
986 "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
987 "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
988 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
989 "created" => ["type" => "datetime", "comment" => ""],
990 "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
991 "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
995 "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
997 "actor-id" => ["actor-id"],
998 "target-uri-id" => ["target-uri-id"],
999 "parent-uri-id" => ["parent-uri-id"],
1000 "seen_uid" => ["seen", "uid"],
1001 "uid_type_parent-uri-id_actor-id" => ["uid", "type", "parent-uri-id", "actor-id"],
1005 "comment" => "[Deprecated] User notifications",
1007 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1008 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1009 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1010 "url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1011 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1012 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1013 "msg" => ["type" => "mediumtext", "comment" => ""],
1014 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1015 "link" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1016 "iid" => ["type" => "int unsigned", "comment" => ""],
1017 "parent" => ["type" => "int unsigned", "comment" => ""],
1018 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
1019 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1020 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1021 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
1022 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
1023 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
1024 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
1027 "PRIMARY" => ["id"],
1028 "seen_uid_date" => ["seen", "uid", "date"],
1029 "uid_date" => ["uid", "date"],
1030 "uid_type_link" => ["uid", "type", "link(190)"],
1031 "uri-id" => ["uri-id"],
1032 "parent-uri-id" => ["parent-uri-id"],
1035 "notify-threads" => [
1038 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1039 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
1040 "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
1041 "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
1042 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1043 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
1044 "comment" => "User id"],
1047 "PRIMARY" => ["id"],
1048 "master-parent-uri-id" => ["master-parent-uri-id"],
1049 "receiver-uid" => ["receiver-uid"],
1050 "notify-id" => ["notify-id"],
1054 "comment" => "cache for OEmbed queries",
1056 "url" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1057 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
1058 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
1059 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1062 "PRIMARY" => ["url", "maxwidth"],
1063 "created" => ["created"],
1066 "openwebauth-token" => [
1067 "comment" => "Store OpenWebAuth token to verify contacts",
1069 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1070 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
1071 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1072 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1073 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1074 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1077 "PRIMARY" => ["id"],
1082 "comment" => "cache for 'parse_url' queries",
1084 "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
1085 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1086 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1087 "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
1088 "content" => ["type" => "mediumtext", "comment" => "page data"],
1089 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1090 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
1093 "PRIMARY" => ["url_hash", "guessing", "oembed"],
1094 "created" => ["created"],
1095 "expires" => ["expires"],
1099 "comment" => "personal (per user) configuration storage",
1101 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
1102 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1103 "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
1104 "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1105 "v" => ["type" => "mediumtext", "comment" => "Value"],
1108 "PRIMARY" => ["id"],
1109 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1113 "comment" => "photo storage",
1115 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1116 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1117 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1118 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1119 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1120 "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1121 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1122 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1123 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1124 "desc" => ["type" => "text", "comment" => ""],
1125 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1126 "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
1127 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1128 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1129 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1130 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1131 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1132 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1133 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1134 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1135 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1136 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1137 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1138 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1139 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1140 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1141 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1142 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1145 "PRIMARY" => ["id"],
1146 "contactid" => ["contact-id"],
1147 "uid_contactid" => ["uid", "contact-id"],
1148 "uid_profile" => ["uid", "profile"],
1149 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1150 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1151 "resource-id" => ["resource-id"],
1152 "uid_photo-type" => ["uid", "photo-type"],
1156 "comment" => "Structure for all posts",
1158 "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"],
1159 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1160 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1161 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1162 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1163 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1164 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1165 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1166 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1167 "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"],
1168 "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"],
1169 "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"],
1170 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1171 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1172 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1173 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1174 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1175 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1178 "PRIMARY" => ["uri-id"],
1179 "parent-uri-id" => ["parent-uri-id"],
1180 "thr-parent-id" => ["thr-parent-id"],
1181 "external-id" => ["external-id"],
1182 "owner-id" => ["owner-id"],
1183 "author-id" => ["author-id"],
1184 "causer-id" => ["causer-id"],
1188 "post-activity" => [
1189 "comment" => "Original remote activity",
1191 "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"],
1192 "activity" => ["type" => "mediumtext", "comment" => "Original activity"],
1193 "received" => ["type" => "datetime", "comment" => ""],
1196 "PRIMARY" => ["uri-id"],
1199 "post-category" => [
1200 "comment" => "post relation to categories",
1202 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1203 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1204 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1205 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1208 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1210 "uid_uri-id" => ["uid", "uri-id"],
1213 "post-collection" => [
1214 "comment" => "Collection of 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 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "0 - Featured"],
1218 "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Author of the featured post"],
1221 "PRIMARY" => ["uri-id", "type"],
1223 "author-id" => ["author-id"],
1227 "comment" => "Content for all posts",
1229 "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"],
1230 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1231 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1232 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1233 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1234 "quote-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the quoted uri"],
1235 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1236 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1237 "language" => ["type" => "text", "comment" => "Language information about this post"],
1238 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1239 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1240 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1241 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1242 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1243 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1244 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1245 "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"],
1246 "plink" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1249 "PRIMARY" => ["uri-id"],
1250 "plink" => ["plink(191)"],
1251 "resource-id" => ["resource-id"],
1252 "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1253 "quote-uri-id" => ["quote-uri-id"],
1256 "post-delivery" => [
1257 "comment" => "Delivery data for posts for the batch processing",
1259 "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"],
1260 "inbox-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
1261 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Delivering user"],
1262 "created" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
1263 "command" => ["type" => "varbinary(32)", "comment" => ""],
1264 "failed" => ["type" => "tinyint", "default" => 0, "comment" => "Number of times the delivery has failed"],
1265 "receivers" => ["type" => "mediumtext", "comment" => "JSON encoded array with the receiving contacts"],
1268 "PRIMARY" => ["uri-id", "inbox-id"],
1269 "inbox-id_created" => ["inbox-id", "created"],
1273 "post-delivery-data" => [
1274 "comment" => "Delivery data for items",
1276 "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"],
1277 "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"],
1278 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1279 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1280 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1281 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1282 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1283 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1284 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1285 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1286 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1289 "PRIMARY" => ["uri-id"],
1293 "comment" => "Post history",
1295 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1296 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "primary" => "1", "comment" => "Date of edit"],
1297 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1298 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1299 "body" => ["type" => "mediumtext", "comment" => "item body content"],
1300 "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1301 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1302 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1303 "language" => ["type" => "text", "comment" => "Language information about this post"],
1304 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1305 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1306 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1307 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1308 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1309 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1310 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1311 "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"],
1312 "plink" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1315 "PRIMARY" => ["uri-id", "edited"],
1319 "comment" => "Post related external links",
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(511)", "not null" => "1", "comment" => "External URL"],
1324 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1327 "PRIMARY" => ["id"],
1328 "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1332 "comment" => "Attached media",
1334 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1335 "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"],
1336 "url" => ["type" => "varbinary(1024)", "not null" => "1", "comment" => "Media URL"],
1337 "media-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the activities uri-id"],
1338 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1339 "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1340 "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1341 "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1342 "size" => ["type" => "bigint unsigned", "comment" => "Media size"],
1343 "preview" => ["type" => "varbinary(512)", "comment" => "Preview URL"],
1344 "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1345 "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1346 "description" => ["type" => "text", "comment" => ""],
1347 "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1348 "author-url" => ["type" => "varbinary(383)", "comment" => "URL of the author of the media"],
1349 "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1350 "author-image" => ["type" => "varbinary(383)", "comment" => "Image of the author of the media"],
1351 "publisher-url" => ["type" => "varbinary(383)", "comment" => "URL of the publisher of the media"],
1352 "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1353 "publisher-image" => ["type" => "varbinary(383)", "comment" => "Image of the publisher of the media"],
1356 "PRIMARY" => ["id"],
1357 "uri-id-url" => ["UNIQUE", "uri-id", "url(512)"],
1358 "uri-id-id" => ["uri-id", "id"],
1359 "media-uri-id" => ["media-uri-id"],
1362 "post-question" => [
1363 "comment" => "Question",
1365 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1366 "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"],
1367 "multiple" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Multiple choice"],
1368 "voters" => ["type" => "int unsigned", "comment" => "Number of voters for this question"],
1369 "end-time" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Question end time"],
1372 "PRIMARY" => ["id"],
1373 "uri-id" => ["UNIQUE", "uri-id"],
1376 "post-question-option" => [
1377 "comment" => "Question option",
1379 "id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "Id of the question"],
1380 "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"],
1381 "name" => ["type" => "varchar(255)", "comment" => "Name of the option"],
1382 "replies" => ["type" => "int unsigned", "comment" => "Number of replies for this question option"],
1385 "PRIMARY" => ["uri-id", "id"],
1389 "comment" => "post relation to tags",
1391 "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"],
1392 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1393 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1394 "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"],
1397 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1403 "comment" => "Thread related data",
1405 "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"],
1406 "conversation-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the conversation uri"],
1407 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1408 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1409 "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"],
1410 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1411 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1412 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1413 "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"],
1414 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1417 "PRIMARY" => ["uri-id"],
1418 "conversation-id" => ["conversation-id"],
1419 "owner-id" => ["owner-id"],
1420 "author-id" => ["author-id"],
1421 "causer-id" => ["causer-id"],
1422 "received" => ["received"],
1423 "commented" => ["commented"],
1427 "comment" => "User specific post data",
1429 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1430 "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"],
1431 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1432 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1433 "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1434 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1435 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1436 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1437 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1438 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1439 "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"],
1440 "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"],
1441 "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"],
1442 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1443 "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1444 "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1445 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1446 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1447 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1448 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1449 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1450 "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1451 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1452 "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1453 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1454 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1455 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1456 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1457 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1458 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1461 "PRIMARY" => ["id"],
1462 "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1463 "uri-id" => ["uri-id"],
1464 "parent-uri-id" => ["parent-uri-id"],
1465 "thr-parent-id" => ["thr-parent-id"],
1466 "external-id" => ["external-id"],
1467 "owner-id" => ["owner-id"],
1468 "author-id" => ["author-id"],
1469 "causer-id" => ["causer-id"],
1471 "contact-id" => ["contact-id"],
1472 "event-id" => ["event-id"],
1474 "author-id_uid" => ["author-id", "uid"],
1475 "author-id_received" => ["author-id", "received"],
1476 "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1477 "uid_wall_received" => ["uid", "wall", "received"],
1478 "uid_contactid" => ["uid", "contact-id"],
1479 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1480 "uid_unseen" => ["uid", "unseen"],
1481 "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1484 "post-thread-user" => [
1485 "comment" => "Thread related data per user",
1487 "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"],
1488 "conversation-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the conversation uri"],
1489 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1490 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1491 "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"],
1492 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1493 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1494 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1495 "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"],
1496 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1497 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1498 "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
1499 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1500 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1501 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1502 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1503 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1504 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
1505 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1506 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1507 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1508 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1509 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1510 "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1513 "PRIMARY" => ["uid", "uri-id"],
1514 "uri-id" => ["uri-id"],
1515 "conversation-id" => ["conversation-id"],
1516 "owner-id" => ["owner-id"],
1517 "author-id" => ["author-id"],
1518 "causer-id" => ["causer-id"],
1520 "contact-id" => ["contact-id"],
1522 "post-user-id" => ["post-user-id"],
1523 "commented" => ["commented"],
1524 "uid_received" => ["uid", "received"],
1525 "uid_wall_received" => ["uid", "wall", "received"],
1526 "uid_commented" => ["uid", "commented"],
1527 "uid_starred" => ["uid", "starred"],
1528 "uid_mention" => ["uid", "mention"],
1531 "post-user-notification" => [
1532 "comment" => "User post notifications",
1534 "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"],
1535 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1536 "notification-type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1539 "PRIMARY" => ["uid", "uri-id"],
1540 "uri-id" => ["uri-id"],
1544 "comment" => "Currently running system processes",
1546 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1547 "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
1548 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1549 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1552 "PRIMARY" => ["pid", "hostname"],
1553 "command" => ["command"],
1557 "comment" => "user profiles data",
1559 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1560 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1561 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1562 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1563 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1564 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1565 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1566 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1567 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1568 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1569 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1570 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1571 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1572 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1573 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1574 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1575 "with" => ["type" => "text", "comment" => "Deprecated"],
1576 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1577 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1578 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1579 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1580 "pub_keywords" => ["type" => "text", "comment" => ""],
1581 "prv_keywords" => ["type" => "text", "comment" => ""],
1582 "likes" => ["type" => "text", "comment" => "Deprecated"],
1583 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1584 "about" => ["type" => "text", "comment" => "Profile description"],
1585 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1586 "music" => ["type" => "text", "comment" => "Deprecated"],
1587 "book" => ["type" => "text", "comment" => "Deprecated"],
1588 "tv" => ["type" => "text", "comment" => "Deprecated"],
1589 "film" => ["type" => "text", "comment" => "Deprecated"],
1590 "interest" => ["type" => "text", "comment" => "Deprecated"],
1591 "romance" => ["type" => "text", "comment" => "Deprecated"],
1592 "work" => ["type" => "text", "comment" => "Deprecated"],
1593 "education" => ["type" => "text", "comment" => "Deprecated"],
1594 "contact" => ["type" => "text", "comment" => "Deprecated"],
1595 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1596 "homepage_verified" => ["type" => "boolean", "not null" => 1, "default" => "0", "comment" => "was the homepage verified by a rel-me link back to the profile"],
1597 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
1598 "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
1599 "photo" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1600 "thumb" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1601 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1602 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1605 "PRIMARY" => ["id"],
1606 "uid_is-default" => ["uid", "is-default"],
1607 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1610 "profile_field" => [
1611 "comment" => "Custom profile fields",
1613 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1614 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1615 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1616 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1617 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1618 "value" => ["type" => "text", "comment" => "Value of the field"],
1619 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1620 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1623 "PRIMARY" => ["id"],
1625 "order" => ["order"],
1629 "push_subscriber" => [
1630 "comment" => "Used for OStatus: Contains feed subscribers",
1632 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1633 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1634 "callback_url" => ["type" => "varbinary(383)", "not null" => "1", "default" => "", "comment" => ""],
1635 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1636 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1637 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1638 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1639 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1640 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1641 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1644 "PRIMARY" => ["id"],
1645 "next_try" => ["next_try"],
1650 "comment" => "registrations requiring admin approval",
1652 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1653 "hash" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1654 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1655 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1656 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1657 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1658 "note" => ["type" => "text", "comment" => ""],
1661 "PRIMARY" => ["id"],
1668 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1669 "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Reporting user"],
1670 "cid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["contact" => "id"], "comment" => "Reported contact"],
1671 "comment" => ["type" => "text", "comment" => "Report"],
1672 "forward" => ["type" => "boolean", "comment" => "Forward the report to the remote server"],
1673 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1674 "status" => ["type" => "tinyint unsigned", "comment" => "Status of the report"],
1677 "PRIMARY" => ["id"],
1685 "rid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["report" => "id"], "comment" => "Report id"],
1686 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Uri-id of the reported post"],
1687 "status" => ["type" => "tinyint unsigned", "comment" => "Status of the reported post"],
1690 "PRIMARY" => ["rid", "uri-id"],
1691 "uri-id" => ["uri-id"],
1697 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1698 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1699 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1702 "PRIMARY" => ["id"],
1703 "uid_term" => ["uid", "term(64)"],
1704 "term" => ["term(64)"]
1708 "comment" => "web session storage",
1710 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1711 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1712 "data" => ["type" => "text", "comment" => ""],
1713 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1716 "PRIMARY" => ["id"],
1717 "sid" => ["sid(64)"],
1718 "expire" => ["expire"],
1722 "comment" => "Data stored by Database storage backend",
1724 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1725 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1732 "comment" => "Push Subscription for the API",
1734 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1735 "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""],
1736 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1737 "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"],
1738 "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"],
1739 "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"],
1740 "follow" => ["type" => "boolean", "comment" => ""],
1741 "favourite" => ["type" => "boolean", "comment" => ""],
1742 "reblog" => ["type" => "boolean", "comment" => ""],
1743 "mention" => ["type" => "boolean", "comment" => ""],
1744 "poll" => ["type" => "boolean", "comment" => ""],
1745 "follow_request" => ["type" => "boolean", "comment" => ""],
1746 "status" => ["type" => "boolean", "comment" => ""],
1749 "PRIMARY" => ["id"],
1750 "application-id_uid" => ["UNIQUE", "application-id", "uid"],
1751 "uid_application-id" => ["uid", "application-id"],
1755 "comment" => "Deleted usernames",
1757 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1758 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1761 "PRIMARY" => ["id"],
1762 "username" => ["username(32)"],
1766 "comment" => "User specific public contact data",
1768 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1769 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1770 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
1771 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1772 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1773 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
1774 "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
1775 "is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"],
1776 "pending" => ["type" => "boolean", "comment" => ""],
1777 "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
1778 "info" => ["type" => "mediumtext", "comment" => ""],
1779 "notify_new_posts" => ["type" => "boolean", "comment" => ""],
1780 "remote_self" => ["type" => "boolean", "comment" => ""],
1781 "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => ""],
1782 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
1783 "subhub" => ["type" => "boolean", "comment" => ""],
1784 "hub-verify" => ["type" => "varbinary(383)", "comment" => ""],
1785 "protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
1786 "rating" => ["type" => "tinyint", "comment" => "Automatically detected feed poll frequency"],
1787 "priority" => ["type" => "tinyint unsigned", "comment" => "Feed poll priority"],
1790 "PRIMARY" => ["uid", "cid"],
1792 "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
1795 "arrived-activity" => [
1796 "comment" => "Id of arrived activities",
1798 "object-id" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "object id of the incoming activity"],
1799 "received" => ["type" => "datetime", "comment" => "Receiving date"],
1802 "PRIMARY" => ["object-id"],
1804 "engine" => "MEMORY",
1806 "fetched-activity" => [
1807 "comment" => "Id of fetched activities",
1809 "object-id" => ["type" => "varbinary(383)", "not null" => "1", "primary" => "1", "comment" => "object id of fetched activity"],
1810 "received" => ["type" => "datetime", "comment" => "Receiving date"],
1813 "PRIMARY" => ["object-id"],
1815 "engine" => "MEMORY",
1818 "comment" => "Inter process communication between the frontend and the worker",
1820 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1821 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1824 "PRIMARY" => ["key"],
1826 "engine" => "MEMORY",