3 * @copyright Copyright (C) 2020, Friendica
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.
24 * Syntax (braces indicate optionale values):
26 * "comment" => "Description of the table",
29 * "type" => "<field type>{(<field size>)} <unsigned>",
31 * {"extra" => "auto_increment",}
32 * {"default" => "<default value>",}
33 * {"default" => NULL_DATE,} (for datetime fields)
35 * {"foreign|relation" => ["<foreign key table name>" => "<foreign key field name>"],}
36 * "comment" => "Description of the fields"
41 * "PRIMARY" => ["<primary key field name>", ...],
42 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
47 * Whenever possible prefer "foreign" before "relation" with the foreign keys.
48 * "foreign" adds true foreign keys on the database level, while "relation" simulates this behaviour.
50 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
54 use Friendica\Database\DBA;
56 if (!defined('DB_UPDATE_VERSION')) {
57 define('DB_UPDATE_VERSION', 1367);
63 "comment" => "Global servers",
65 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
66 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
67 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
68 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
69 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70 "info" => ["type" => "text", "comment" => ""],
71 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
72 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
73 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
74 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
75 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
76 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
77 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
78 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
79 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
80 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
81 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
82 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
83 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
84 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
85 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
89 "nurl" => ["UNIQUE", "nurl(190)"],
93 "comment" => "contact table",
95 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
96 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
97 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
98 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
99 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
100 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
101 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
102 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
103 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
104 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
105 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
106 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
107 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
108 "about" => ["type" => "text", "comment" => ""],
109 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
110 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
111 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
112 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
113 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
114 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
115 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
116 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
117 "site-pubkey" => ["type" => "text", "comment" => ""],
118 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
119 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
120 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
121 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
122 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
123 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
124 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
125 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
126 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
127 "request" => ["type" => "varchar(255)", "comment" => ""],
128 "notify" => ["type" => "varchar(255)", "comment" => ""],
129 "poll" => ["type" => "varchar(255)", "comment" => ""],
130 "confirm" => ["type" => "varchar(255)", "comment" => ""],
131 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
132 "poco" => ["type" => "varchar(255)", "comment" => ""],
133 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
134 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
135 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
136 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
137 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
138 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
139 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
140 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
141 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
142 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
143 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
144 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
145 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
146 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
147 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
148 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
149 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
150 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
151 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
152 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
153 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
154 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
155 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
156 "manually-approve" => ["type" => "boolean", "comment" => ""],
157 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
158 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
159 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
160 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
161 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
162 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
163 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
164 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
165 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
166 "reason" => ["type" => "text", "comment" => ""],
167 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
168 "info" => ["type" => "mediumtext", "comment" => ""],
169 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
170 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
171 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
172 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
173 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
174 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
178 "uid_name" => ["uid", "name(190)"],
179 "self_uid" => ["self", "uid"],
180 "alias_uid" => ["alias(96)", "uid"],
181 "pending_uid" => ["pending", "uid"],
182 "blocked_uid" => ["blocked", "uid"],
183 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
184 "uid_network_batch" => ["uid", "network", "batch(64)"],
185 "addr_uid" => ["addr(96)", "uid"],
186 "nurl_uid" => ["nurl(96)", "uid"],
187 "nick_uid" => ["nick(32)", "uid"],
188 "attag_uid" => ["attag(96)", "uid"],
189 "dfrn-id" => ["dfrn-id(64)"],
190 "issued-id" => ["issued-id(64)"],
191 "network_uid_lastupdate" => ["network", "uid", "last-update"],
192 "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
193 "uid_lastitem" => ["uid", "last-item"],
198 "comment" => "URI and GUID for items",
200 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
201 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
202 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
206 "uri" => ["UNIQUE", "uri"],
211 "comment" => "tags and mentions",
213 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
214 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
215 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
219 "type_name_url" => ["UNIQUE", "name", "url"],
224 "comment" => "The local users",
226 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
227 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
228 "comment" => "The parent user that has full control about this user"],
229 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
230 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
231 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
232 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
233 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
234 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
235 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
236 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
237 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
238 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
239 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
240 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
241 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
242 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
243 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
244 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
245 "spubkey" => ["type" => "text", "comment" => ""],
246 "sprvkey" => ["type" => "text", "comment" => ""],
247 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
248 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
249 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
250 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
251 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
252 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
253 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
254 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
255 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
256 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
257 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
258 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
259 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
260 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
261 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
262 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
263 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
264 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
265 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
266 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
267 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
268 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
269 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
270 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
271 "openidserver" => ["type" => "text", "comment" => ""],
274 "PRIMARY" => ["uid"],
275 "nickname" => ["nickname(32)"],
279 "comment" => "OAuth usage",
281 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
282 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
283 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
284 "name" => ["type" => "text", "comment" => ""],
285 "icon" => ["type" => "text", "comment" => ""],
286 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
289 "PRIMARY" => ["client_id"],
296 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
297 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
298 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
299 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
300 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
301 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
305 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
309 "2fa_app_specific_password" => [
310 "comment" => "Two-factor app-specific _password",
312 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
313 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
314 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
315 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
316 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
317 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
321 "uid_description" => ["uid", "description(190)"],
324 "2fa_recovery_codes" => [
325 "comment" => "Two-factor authentication recovery codes",
327 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
328 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
329 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
330 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
333 "PRIMARY" => ["uid", "code"]
337 "comment" => "registered addons",
339 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
340 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
341 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
342 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
343 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
344 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
345 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
349 "name" => ["UNIQUE", "name"],
353 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
355 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
356 "uuid" => ["type" => "varchar(255)", "comment" => ""],
357 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
358 "following" => ["type" => "varchar(255)", "comment" => ""],
359 "followers" => ["type" => "varchar(255)", "comment" => ""],
360 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
361 "outbox" => ["type" => "varchar(255)", "comment" => ""],
362 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
363 "manually-approve" => ["type" => "boolean", "comment" => ""],
364 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
365 "name" => ["type" => "varchar(255)", "comment" => ""],
366 "about" => ["type" => "text", "comment" => ""],
367 "photo" => ["type" => "varchar(255)", "comment" => ""],
368 "addr" => ["type" => "varchar(255)", "comment" => ""],
369 "alias" => ["type" => "varchar(255)", "comment" => ""],
370 "pubkey" => ["type" => "text", "comment" => ""],
371 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
372 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
373 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
374 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
375 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
376 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
377 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
378 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
381 "PRIMARY" => ["url"],
382 "addr" => ["addr(32)"],
383 "alias" => ["alias(190)"],
384 "followers" => ["followers(190)"],
385 "baseurl" => ["baseurl(190)"],
390 "comment" => "file attachments",
392 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
393 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
394 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
395 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
396 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
397 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
398 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
399 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
400 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
401 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
402 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
403 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
404 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
405 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
406 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
414 "comment" => "OAuth usage",
416 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
417 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
419 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
420 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
421 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
425 "client_id" => ["client_id"]
429 "comment" => "Stores temporary data",
431 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
432 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
433 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
434 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
438 "k_expires" => ["k", "expires"],
444 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
445 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
446 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
447 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
448 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
449 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
456 "comment" => "main configuration storage",
458 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
459 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
460 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
461 "v" => ["type" => "mediumtext", "comment" => ""],
465 "cat_k" => ["UNIQUE", "cat", "k"],
468 "contact-relation" => [
469 "comment" => "Contact relations",
471 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
472 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
473 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
474 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
475 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
478 "PRIMARY" => ["cid", "relation-cid"],
479 "relation-cid" => ["relation-cid"],
483 "comment" => "private messages",
485 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
486 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
487 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
488 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
489 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
490 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
491 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
492 "subject" => ["type" => "text", "comment" => "subject of initial message"],
500 "comment" => "Raw data and structure information for messages",
502 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
503 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
504 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
505 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
506 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
507 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
508 "source" => ["type" => "mediumtext", "comment" => "Original source"],
509 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
512 "PRIMARY" => ["item-uri"],
513 "conversation-uri" => ["conversation-uri"],
514 "received" => ["received"],
517 "diaspora-interaction" => [
518 "comment" => "Signed Diaspora Interaction",
520 "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"],
521 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
524 "PRIMARY" => ["uri-id"]
528 "comment" => "Events",
530 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
531 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
532 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
533 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
534 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
535 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
536 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
537 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
538 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
539 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
540 "desc" => ["type" => "text", "comment" => "event description"],
541 "location" => ["type" => "text", "comment" => "event location"],
542 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
543 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
544 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
545 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
546 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
547 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
548 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
549 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
553 "uid_start" => ["uid", "start"],
558 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
560 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
561 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
562 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
563 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
564 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
565 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
566 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
567 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
568 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
569 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
570 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
571 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
572 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
573 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
574 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
575 "pubkey" => ["type" => "text", "comment" => ""],
576 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
580 "addr" => ["addr(32)"],
581 "url" => ["UNIQUE", "url(190)"],
585 "comment" => "friend suggestion stuff",
587 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
588 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
589 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
590 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
591 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
592 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
593 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
594 "note" => ["type" => "text", "comment" => ""],
595 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
604 "comment" => "privacy groups, group info",
606 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
607 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
608 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
609 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
610 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
618 "comment" => "privacy groups, member info",
620 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
621 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
622 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
626 "contactid" => ["contact-id"],
627 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
631 "comment" => "Tags that the server has subscribed",
633 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
634 "comment" => "The id of the gserver"],
635 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
638 "PRIMARY" => ["gserver-id", "tag"],
643 "comment" => "addon hook registry",
645 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
646 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
647 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
648 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
649 "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"],
653 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
657 "comment" => "Hostname",
659 "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
660 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "The hostname"],
664 "name" => ["UNIQUE", "name"],
668 "comment" => "Status of ActivityPub inboxes",
670 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
671 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
672 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
673 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
674 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
675 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
676 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
685 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
686 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
687 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
688 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
689 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
690 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
691 "note" => ["type" => "text", "comment" => ""],
692 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
693 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
694 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
695 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
699 "contact-id" => ["contact-id"],
704 "comment" => "Structure for all posts",
706 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
707 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
708 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
709 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
710 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
711 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"],
712 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
713 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
714 "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"],
715 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
716 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
717 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
718 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
719 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
720 "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"],
721 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
722 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
723 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
724 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
725 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
726 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
727 "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "comment" => "Id of the verb table entry that contains the activity verbs"],
728 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
729 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
730 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
731 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
732 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
733 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
734 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
735 // User specific fields. Eventually they will move to user-item
736 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
737 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
738 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
739 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
740 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
741 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
742 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
743 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
744 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
745 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
746 // It has to be decided whether these fields belong to the user or the structure
747 "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"],
748 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
749 // Could possibly be replaced by the "attach" table?
750 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
751 // Deprecated fields. Will be removed in upcoming versions
752 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
753 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
754 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
755 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
756 "postopts" => ["type" => "text", "comment" => "Deprecated"],
757 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
758 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
759 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
760 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
761 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
762 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
763 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
764 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
765 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
766 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
767 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
768 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
769 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
770 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
771 "object" => ["type" => "text", "comment" => "Deprecated"],
772 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
773 "target" => ["type" => "text", "comment" => "Deprecated"],
774 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
775 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
776 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
777 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
778 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
779 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
780 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
781 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
785 "guid" => ["guid(191)"],
786 "uri" => ["uri(191)"],
787 "parent" => ["parent"],
788 "parent-uri" => ["parent-uri(191)"],
789 "extid" => ["extid(191)"],
790 "uid_id" => ["uid", "id"],
791 "uid_contactid_id" => ["uid", "contact-id", "id"],
792 "uid_received" => ["uid", "received"],
793 "uid_commented" => ["uid", "commented"],
794 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
795 "uid_network_received" => ["uid", "network", "received"],
796 "uid_network_commented" => ["uid", "network", "commented"],
797 "uid_thrparent" => ["uid", "thr-parent(190)"],
798 "uid_parenturi" => ["uid", "parent-uri(190)"],
799 "uid_contactid_received" => ["uid", "contact-id", "received"],
800 "authorid_received" => ["author-id", "received"],
801 "ownerid" => ["owner-id"],
802 "contact-id" => ["contact-id"],
803 "uid_uri" => ["uid", "uri(190)"],
804 "resource-id" => ["resource-id"],
805 "deleted_changed" => ["deleted", "changed"],
806 "uid_wall_changed" => ["uid", "wall", "changed"],
807 "uid_unseen_wall" => ["uid", "unseen", "wall"],
808 "mention_uid_id" => ["mention", "uid", "id"],
809 "uid_eventid" => ["uid", "event-id"],
812 "psid_wall" => ["psid", "wall"],
813 "uri-id" => ["uri-id"],
814 "parent-uri-id" => ["parent-uri-id"],
815 "thr-parent-id" => ["thr-parent-id"],
819 "comment" => "Activities for items",
821 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
822 "uri" => ["type" => "varchar(255)", "comment" => ""],
823 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
824 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
825 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
829 "uri-hash" => ["UNIQUE", "uri-hash"],
830 "uri" => ["uri(191)"],
831 "uri-id" => ["uri-id"]
835 "comment" => "Content for all posts",
837 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
838 "uri" => ["type" => "varchar(255)", "comment" => ""],
839 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
840 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
841 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
842 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
843 "body" => ["type" => "mediumtext", "comment" => "item body content"],
844 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
845 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
846 "language" => ["type" => "text", "comment" => "Language information about this post"],
847 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
848 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
849 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
850 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
851 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
852 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
853 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
854 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
855 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
859 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
860 "uri" => ["uri(191)"],
861 "plink" => ["plink(191)"],
862 "uri-id" => ["uri-id"]
868 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
869 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
870 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
871 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
872 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
876 "name_expires" => ["name", "expires"]
880 "comment" => "private messages",
882 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
883 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
884 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
885 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
886 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
887 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
888 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
889 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
890 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
891 "body" => ["type" => "mediumtext", "comment" => ""],
892 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
893 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
894 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
895 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
896 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
897 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
898 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
902 "uid_seen" => ["uid", "seen"],
903 "convid" => ["convid"],
904 "uri" => ["uri(64)"],
905 "parent-uri" => ["parent-uri(64)"],
906 "contactid" => ["contact-id(32)"],
910 "comment" => "Mail account data for fetching mails",
912 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
913 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
914 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
915 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
916 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
917 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
918 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
919 "pass" => ["type" => "text", "comment" => ""],
920 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
921 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
922 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
923 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
924 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
932 "comment" => "table of accounts that can manage each other",
934 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
935 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
936 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
940 "uid_mid" => ["UNIQUE", "uid", "mid"],
945 "comment" => "notifications",
947 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
948 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
949 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
950 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
951 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
952 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
953 "msg" => ["type" => "mediumtext", "comment" => ""],
954 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
955 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
956 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
957 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
958 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
959 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
960 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
961 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
962 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
963 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
964 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
968 "seen_uid_date" => ["seen", "uid", "date"],
969 "uid_date" => ["uid", "date"],
970 "uid_type_link" => ["uid", "type", "link(190)"],
973 "notify-threads" => [
976 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
977 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
978 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
979 "master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
980 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
981 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
982 "comment" => "User id"],
986 "master-parent-uri-id" => ["master-parent-uri-id"],
987 "receiver-uid" => ["receiver-uid"],
988 "notify-id" => ["notify-id"],
992 "comment" => "cache for OEmbed queries",
994 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
995 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
996 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
997 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1000 "PRIMARY" => ["url", "maxwidth"],
1001 "created" => ["created"],
1004 "openwebauth-token" => [
1005 "comment" => "Store OpenWebAuth token to verify contacts",
1007 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1008 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id - currently unused"],
1009 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1010 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1011 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1012 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1015 "PRIMARY" => ["id"],
1020 "comment" => "cache for 'parse_url' queries",
1022 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1023 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1024 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1025 "content" => ["type" => "mediumtext", "comment" => "page data"],
1026 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1029 "PRIMARY" => ["url", "guessing", "oembed"],
1030 "created" => ["created"],
1033 "participation" => [
1034 "comment" => "Storage for participation messages from Diaspora",
1036 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item" => "id"], "comment" => ""],
1037 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
1038 "cid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["contact" => "id"], "comment" => ""],
1039 "fid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["fcontact" => "id"], "comment" => ""],
1042 "PRIMARY" => ["iid", "server"],
1048 "comment" => "personal (per user) configuration storage",
1050 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1051 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1052 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
1053 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
1054 "v" => ["type" => "mediumtext", "comment" => ""],
1057 "PRIMARY" => ["id"],
1058 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1062 "comment" => "photo storage",
1064 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1065 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1066 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1067 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1068 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1069 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1070 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1071 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1072 "desc" => ["type" => "text", "comment" => ""],
1073 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1074 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1075 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1076 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1077 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1078 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1079 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1080 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1081 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1082 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1083 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1084 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1085 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1086 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1087 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1088 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1089 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1092 "PRIMARY" => ["id"],
1093 "contactid" => ["contact-id"],
1094 "uid_contactid" => ["uid", "contact-id"],
1095 "uid_profile" => ["uid", "profile"],
1096 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1097 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1098 "resource-id" => ["resource-id"],
1101 "post-category" => [
1102 "comment" => "post relation to categories",
1104 "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"],
1105 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1106 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1107 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1110 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1114 "post-delivery-data" => [
1115 "comment" => "Delivery data for items",
1117 "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"],
1118 "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"],
1119 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1120 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1121 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1122 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1123 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1124 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1125 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1126 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1127 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1130 "PRIMARY" => ["uri-id"],
1134 "comment" => "post relation to tags",
1136 "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"],
1137 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1138 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1139 "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"],
1142 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1148 "comment" => "Currently running system processes",
1150 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1151 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1152 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1155 "PRIMARY" => ["pid"],
1156 "command" => ["command"],
1160 "comment" => "user profiles data",
1162 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1163 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1164 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1165 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1166 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1167 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1168 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1169 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1170 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1171 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1172 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1173 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1174 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1175 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1176 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1177 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1178 "with" => ["type" => "text", "comment" => "Deprecated"],
1179 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1180 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1181 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1182 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1183 "pub_keywords" => ["type" => "text", "comment" => ""],
1184 "prv_keywords" => ["type" => "text", "comment" => ""],
1185 "likes" => ["type" => "text", "comment" => "Deprecated"],
1186 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1187 "about" => ["type" => "text", "comment" => "Profile description"],
1188 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1189 "music" => ["type" => "text", "comment" => "Deprecated"],
1190 "book" => ["type" => "text", "comment" => "Deprecated"],
1191 "tv" => ["type" => "text", "comment" => "Deprecated"],
1192 "film" => ["type" => "text", "comment" => "Deprecated"],
1193 "interest" => ["type" => "text", "comment" => "Deprecated"],
1194 "romance" => ["type" => "text", "comment" => "Deprecated"],
1195 "work" => ["type" => "text", "comment" => "Deprecated"],
1196 "education" => ["type" => "text", "comment" => "Deprecated"],
1197 "contact" => ["type" => "text", "comment" => "Deprecated"],
1198 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1199 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1200 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1201 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1202 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1203 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1206 "PRIMARY" => ["id"],
1207 "uid_is-default" => ["uid", "is-default"],
1208 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1211 "profile_check" => [
1212 "comment" => "DFRN remote auth use",
1214 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1215 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1216 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1217 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1218 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1219 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1222 "PRIMARY" => ["id"],
1227 "profile_field" => [
1228 "comment" => "Custom profile fields",
1230 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1231 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1232 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1233 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1234 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1235 "value" => ["type" => "text", "comment" => "Value of the field"],
1236 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1237 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1240 "PRIMARY" => ["id"],
1242 "order" => ["order"],
1246 "push_subscriber" => [
1247 "comment" => "Used for OStatus: Contains feed subscribers",
1249 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1250 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1251 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1252 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1253 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1254 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1255 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1256 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1257 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1258 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1261 "PRIMARY" => ["id"],
1262 "next_try" => ["next_try"],
1267 "comment" => "registrations requiring admin approval",
1269 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1270 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1271 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1272 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1273 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1274 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1275 "note" => ["type" => "text", "comment" => ""],
1278 "PRIMARY" => ["id"],
1285 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1286 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1287 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1290 "PRIMARY" => ["id"],
1295 "comment" => "web session storage",
1297 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1298 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1299 "data" => ["type" => "text", "comment" => ""],
1300 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1303 "PRIMARY" => ["id"],
1304 "sid" => ["sid(64)"],
1305 "expire" => ["expire"],
1309 "comment" => "Data stored by Database storage backend",
1311 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1312 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1319 "comment" => "Thread related data",
1321 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["item" => "id"],
1322 "comment" => "sequential ID"],
1323 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1324 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1325 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1326 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1327 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1328 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1329 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1330 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1331 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1332 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1333 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1334 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1335 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1336 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1337 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1338 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1339 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1340 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1341 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1342 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1343 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1344 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1345 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1346 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1347 "bookmark" => ["type" => "boolean", "comment" => ""],
1350 "PRIMARY" => ["iid"],
1351 "uid_network_commented" => ["uid", "network", "commented"],
1352 "uid_network_received" => ["uid", "network", "received"],
1353 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1354 "uid_contactid_received" => ["uid", "contact-id", "received"],
1355 "contactid" => ["contact-id"],
1356 "ownerid" => ["owner-id"],
1357 "authorid" => ["author-id"],
1358 "uid_received" => ["uid", "received"],
1359 "uid_commented" => ["uid", "commented"],
1360 "uid_wall_received" => ["uid", "wall", "received"],
1361 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1362 "uri-id" => ["uri-id"],
1366 "comment" => "OAuth usage",
1368 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1369 "secret" => ["type" => "text", "comment" => ""],
1370 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
1371 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1372 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1373 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1376 "PRIMARY" => ["id"],
1377 "client_id" => ["client_id"],
1382 "comment" => "Deleted usernames",
1384 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1385 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1388 "PRIMARY" => ["id"],
1389 "username" => ["username(32)"],
1393 "comment" => "User specific public contact data",
1395 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1396 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1397 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1398 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1399 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1402 "PRIMARY" => ["uid", "cid"],
1407 "comment" => "User specific item data",
1409 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["item" => "id"], "comment" => "Item id"],
1410 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1411 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1412 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1413 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"],
1414 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1417 "PRIMARY" => ["uid", "iid"],
1418 "uid_pinned" => ["uid", "pinned"],
1419 "iid_uid" => ["iid", "uid"]
1423 "comment" => "Activity Verbs",
1425 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1426 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
1433 "comment" => "Inter process communication between the frontend and the worker",
1435 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1436 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1439 "PRIMARY" => ["key"],
1441 "engine" => "MEMORY",
1444 "comment" => "Background tasks queue entries",
1446 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1447 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1448 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1449 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1450 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1451 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1452 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1453 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1454 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1457 "PRIMARY" => ["id"],
1458 "done_parameter" => ["done", "parameter(64)"],
1459 "done_executed" => ["done", "executed"],
1460 "done_priority_created" => ["done", "priority", "created"],
1461 "done_priority_next_try" => ["done", "priority", "next_try"],
1462 "done_pid_next_try" => ["done", "pid", "next_try"],
1463 "done_pid_retrial" => ["done", "pid", "retrial"],
1464 "done_pid_priority_created" => ["done", "pid", "priority", "created"]