]> git.mxchange.org Git - friendica.git/blob - config/dbstructure.json
Merge pull request #5946 from JonnyTischbein/move_include_security
[friendica.git] / config / dbstructure.json
1 {
2         "addon": {
3                 "comment": "registered addons",
4                 "fields": {
5                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": ""},
6                         "name": {"type": "varchar(50)", "not null": "1", "default": "", "comment": "addon base (file)name"},
7                         "version": {"type": "varchar(50)", "not null": "1", "default": "", "comment": "currently unused"},
8                         "installed": {"type": "boolean", "not null": "1", "default": "0", "comment": "currently always 1"},
9                         "hidden": {"type": "boolean", "not null": "1", "default": "0", "comment": "currently unused"},
10                         "timestamp": {"type": "int unsigned", "not null": "1", "default": "0", "comment": "file timestamp to check for reloads"},
11                         "plugin_admin": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 = has admin config, 0 = has no admin config"}
12                 },
13                 "indexes": {
14                         "PRIMARY": ["id"],
15                         "name": ["UNIQUE", "name"]
16                 }
17         },
18         "apcontact": {
19                 "comment": "ActivityPub compatible contacts - used in the ActivityPub implementation",
20                 "fields": {
21                         "url": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "URL of the contact"},
22                         "uuid": {"type": "varchar(255)", "comment": ""},
23                         "type": {"type": "varchar(20)", "not null": "1", "comment": ""},
24                         "following": {"type": "varchar(255)", "comment": ""},
25                         "followers": {"type": "varchar(255)", "comment": ""},
26                         "inbox": {"type": "varchar(255)", "not null": "1", "comment": ""},
27                         "outbox": {"type": "varchar(255)", "comment": ""},
28                         "sharedinbox": {"type": "varchar(255)", "comment": ""},
29                         "nick": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
30                         "name": {"type": "varchar(255)", "comment": ""},
31                         "about": {"type": "text", "comment": ""},
32                         "photo": {"type": "varchar(255)", "comment": ""},
33                         "addr": {"type": "varchar(255)", "comment": ""},
34                         "alias": {"type": "varchar(255)", "comment": ""},
35                         "pubkey": {"type": "text", "comment": ""},
36                         "baseurl": {"type": "varchar(255)", "comment": "baseurl of the ap contact"},
37                         "updated": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""}
38
39                 },
40                 "indexes": {
41                         "PRIMARY": ["url"],
42                         "addr": ["addr(32)"],
43                         "url": ["followers(190)"]
44                 }
45         },
46         "attach": {
47                 "comment": "file attachments",
48                 "fields": {
49                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "generated index"},
50                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
51                         "hash": {"type": "varchar(64)", "not null": "1", "default": "", "comment": "hash"},
52                         "filename": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "filename of original"},
53                         "filetype": {"type": "varchar(64)", "not null": "1", "default": "", "comment": "mimetype"},
54                         "filesize": {"type": "int unsigned", "not null": "1", "default": "0", "comment": "size in bytes"},
55                         "data": {"type": "longblob", "not null": "1", "comment": "file data"},
56                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "creation time"},
57                         "edited": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "last edit time"},
58                         "allow_cid": {"type": "mediumtext", "comment": "Access Control - list of allowed contact.id '<19><78>"},
59                         "allow_gid": {"type": "mediumtext", "comment": "Access Control - list of allowed groups"},
60                         "deny_cid": {"type": "mediumtext", "comment": "Access Control - list of denied contact.id"},
61                         "deny_gid": {"type": "mediumtext", "comment": "Access Control - list of denied groups"}
62                 },
63                 "indexes": {
64                         "PRIMARY": ["id"]
65                 }
66         },
67         "auth_codes": {
68                 "comment": "OAuth usage",
69                 "fields": {
70                         "id": {"type": "varchar(40)", "not null": "1", "primary": "1", "comment": ""},
71                         "client_id": {"type": "varchar(20)", "not null": "1", "default": "", "relation": {"clients": "client_id"}, "comment": ""},
72                         "redirect_uri": {"type": "varchar(200)", "not null": "1", "default": "", "comment": ""},
73                         "expires": {"type": "int", "not null": "1", "default": "0", "comment": ""},
74                         "scope": {"type": "varchar(250)", "not null": "1", "default": "", "comment": ""}
75                 },
76                 "indexes": {
77                         "PRIMARY": ["id"]
78                 }
79         },
80         "cache": {
81                 "comment": "Stores temporary data",
82                 "fields": {
83                         "k": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "cache key"},
84                         "v": {"type": "mediumtext", "comment": "cached serialized value"},
85                         "expires": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime of cache expiration"},
86                         "updated": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime of cache insertion"}
87                 },
88                 "indexes": {
89                         "PRIMARY": ["k"],
90                         "k_expires": ["k", "expires"]
91                 }
92         },
93         "challenge": {
94                 "comment": "",
95                 "fields": {
96                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
97                         "challenge": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
98                         "dfrn-id": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
99                         "expire": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""},
100                         "type": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
101                         "last_update": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""}
102                 },
103                 "indexes": {
104                         "PRIMARY": ["id"]
105                 }
106         },
107         "clients": {
108                 "comment": "OAuth usage",
109                 "fields": {
110                         "client_id": {"type": "varchar(20)", "not null": "1", "primary": "1", "comment": ""},
111                         "pw": {"type": "varchar(20)", "not null": "1", "default": "", "comment": ""},
112                         "redirect_uri": {"type": "varchar(200)", "not null": "1", "default": "", "comment": ""},
113                         "name": {"type": "text", "comment": ""},
114                         "icon": {"type": "text", "comment": ""},
115                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"}
116                 },
117                 "indexes": {
118                         "PRIMARY": ["client_id"]
119                 }
120         },
121         "config": {
122                 "comment": "main configuration storage",
123                 "fields": {
124                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": ""},
125                         "cat": {"type": "varbinary(50)", "not null": "1", "default": "", "comment": ""},
126                         "k": {"type": "varbinary(50)", "not null": "1", "default": "", "comment": ""},
127                         "v": {"type": "mediumtext", "comment": ""}
128                 },
129                 "indexes": {
130                         "PRIMARY": ["id"],
131                         "cat_k": ["UNIQUE", "cat", "k"]
132                 }
133         },
134         "contact": {
135                 "comment": "contact table",
136                 "fields": {
137                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
138                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
139                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
140                         "self": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 if the contact is the user him/her self"},
141                         "remote_self": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
142                         "rel": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": "The kind of the relation between the user and the contact"},
143                         "duplex": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
144                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": "Network protocol of the contact"},
145                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Name that this contact is known by"},
146                         "nick": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Nick- and user name of the contact"},
147                         "location": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
148                         "about": {"type": "text", "comment": ""},
149                         "keywords": {"type": "text", "comment": "public keywords (interests) of the contact"},
150                         "gender": {"type": "varchar(32)", "not null": "1", "default": "", "comment": ""},
151                         "xmpp": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
152                         "attag": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
153                         "avatar": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
154                         "photo": {"type": "varchar(255)", "default": "", "comment": "Link to the profile photo of the contact"},
155                         "thumb": {"type": "varchar(255)", "default": "", "comment": "Link to the profile photo (thumb size)"},
156                         "micro": {"type": "varchar(255)", "default": "", "comment": "Link to the profile photo (micro size)"},
157                         "site-pubkey": {"type": "text", "comment": ""},
158                         "issued-id": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
159                         "dfrn-id": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
160                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
161                         "nurl": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
162                         "addr": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
163                         "alias": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
164                         "pubkey": {"type": "text", "comment": "RSA public key 4096 bit"},
165                         "prvkey": {"type": "text", "comment": "RSA private key 4096 bit"},
166                         "batch": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
167                         "request": {"type": "varchar(255)", "comment": ""},
168                         "notify": {"type": "varchar(255)", "comment": ""},
169                         "poll": {"type": "varchar(255)", "comment": ""},
170                         "confirm": {"type": "varchar(255)", "comment": ""},
171                         "poco": {"type": "varchar(255)", "comment": ""},
172                         "aes_allow": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
173                         "ret-aes": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
174                         "usehub": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
175                         "subhub": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
176                         "hub-verify": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
177                         "last-update": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of the last try to update the contact info"},
178                         "success_update": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of the last successful contact update"},
179                         "failure_update": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of the last failed update"},
180                         "name-date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
181                         "uri-date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
182                         "avatar-date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
183                         "term-date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
184                         "last-item": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "date of the last post"},
185                         "priority": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
186                         "blocked": {"type": "boolean", "not null": "1", "default": "1", "comment": ""},
187                         "readonly": {"type": "boolean", "not null": "1", "default": "0", "comment": "posts of the contact are readonly"},
188                         "writable": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
189                         "forum": {"type": "boolean", "not null": "1", "default": "0", "comment": "contact is a forum"},
190                         "prv": {"type": "boolean", "not null": "1", "default": "0", "comment": "contact is a private group"},
191                         "contact-type": {"type": "tinyint", "not null": "1", "default": "0", "comment": ""},
192                         "hidden": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
193                         "archive": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
194                         "pending": {"type": "boolean", "not null": "1", "default": "1", "comment": ""},
195                         "deleted": {"type": "boolean", "not null": "1", "default": "0", "comment": "Contact has been deleted"},
196                         "rating": {"type": "tinyint", "not null": "1", "default": "0", "comment": ""},
197                         "reason": {"type": "text", "comment": ""},
198                         "closeness": {"type": "tinyint unsigned", "not null": "1", "default": "99", "comment": ""},
199                         "info": {"type": "mediumtext", "comment": ""},
200                         "profile-id": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""},
201                         "bdyear": {"type": "varchar(4)", "not null": "1", "default": "", "comment": ""},
202                         "bd": {"type": "date", "not null": "1", "default": "0001-01-01", "comment": ""},
203                         "notify_new_posts": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
204                         "fetch_further_information": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
205                         "ffi_keyword_blacklist": {"type": "text", "comment": ""}
206                 },
207                 "indexes": {
208                         "PRIMARY": ["id"],
209                         "uid_name": ["uid", "name(190)"],
210                         "self_uid": ["self", "uid"],
211                         "alias_uid": ["alias(32)", "uid"],
212                         "pending_uid": ["pending", "uid"],
213                         "blocked_uid": ["blocked", "uid"],
214                         "uid_rel_network_poll": ["uid", "rel", "network", "poll(64)", "archive"],
215                         "uid_network_batch": ["uid", "network", "batch(64)"],
216                         "addr_uid": ["addr(32)", "uid"],
217                         "nurl_uid": ["nurl(32)", "uid"],
218                         "nick_uid": ["nick(32)", "uid"],
219                         "dfrn-id": ["dfrn-id(64)"],
220                         "issued-id": ["issued-id(64)"]
221                 }
222         },
223         "conv": {
224                 "comment": "private messages",
225                 "fields": {
226                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
227                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "A unique identifier for this conversation"},
228                         "recips": {"type": "text", "comment": "sender_handle;recipient_handle"},
229                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
230                         "creator": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "handle of creator"},
231                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "creation timestamp"},
232                         "updated": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "edited timestamp"},
233                         "subject": {"type": "text", "comment": "subject of initial message"}
234                 },
235                 "indexes": {
236                         "PRIMARY": ["id"],
237                         "uid": ["uid"]
238                 }
239         },
240         "conversation": {
241                 "comment": "Raw data and structure information for messages",
242                 "fields": {
243                         "item-uri": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "Original URI of the item - unrelated to the table with the same name"},
244                         "reply-to-uri": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": "URI to which this item is a reply"},
245                         "conversation-uri": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": "GNU Social conversation URI"},
246                         "conversation-href": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": "GNU Social conversation link"},
247                         "protocol": {"type": "tinyint unsigned", "not null": "1", "default": "255", "comment": "The protocol of the item"},
248                         "source": {"type": "mediumtext", "comment": "Original source"},
249                         "received": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Receiving date"}
250                 },
251                 "indexes": {
252                         "PRIMARY": ["item-uri"],
253                         "conversation-uri": ["conversation-uri"],
254                         "received": ["received"]
255                 }
256         },
257         "diaspora-interaction": {
258                 "comment": "Signed Diaspora Interaction",
259                 "fields": {
260                         "uri-id": {"type": "int unsigned", "not null": "1", "primary": "1", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
261                         "interaction": {"type": "mediumtext", "comment": "The Diaspora interaction"}
262                 },
263                 "indexes": {
264                         "PRIMARY": ["uri-id"]
265                 }
266         },
267         "event": {
268                 "comment": "Events",
269                 "fields": {
270                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
271                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
272                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
273                         "cid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "contact_id (ID of the contact in contact table)"},
274                         "uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
275                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "creation time"},
276                         "edited": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "last edit time"},
277                         "start": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "event start time"},
278                         "finish": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "event end time"},
279                         "summary": {"type": "text", "comment": "short description or title of the event"},
280                         "desc": {"type": "text", "comment": "event description"},
281                         "location": {"type": "text", "comment": "event location"},
282                         "type": {"type": "varchar(20)", "not null": "1", "default": "", "comment": "event or birthday"},
283                         "nofinish": {"type": "boolean", "not null": "1", "default": "0", "comment": "if event does have no end this is 1"},
284                         "adjust": {"type": "boolean", "not null": "1", "default": "1", "comment": "adjust to timezone of the recipient (0 or 1)"},
285                         "ignore": {"type": "boolean", "not null": "1", "default": "0", "comment": "0 or 1"},
286                         "allow_cid": {"type": "mediumtext", "comment": "Access Control - list of allowed contact.id '<19><78>'"},
287                         "allow_gid": {"type": "mediumtext", "comment": "Access Control - list of allowed groups"},
288                         "deny_cid": {"type": "mediumtext", "comment": "Access Control - list of denied contact.id"},
289                         "deny_gid": {"type": "mediumtext", "comment": "Access Control - list of denied groups"}
290                 },
291                 "indexes": {
292                         "PRIMARY": ["id"],
293                         "uid_start": ["uid", "start"]
294                 }
295         },
296         "fcontact": {
297                 "comment": "Diaspora compatible contacts - used in the Diaspora implementation",
298                 "fields": {
299                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
300                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "unique id"},
301                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
302                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
303                         "photo": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
304                         "request": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
305                         "nick": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
306                         "addr": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
307                         "batch": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
308                         "notify": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
309                         "poll": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
310                         "confirm": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
311                         "priority": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
312                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": ""},
313                         "alias": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
314                         "pubkey": {"type": "text", "comment": ""},
315                         "updated": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""}
316                 },
317                 "indexes": {
318                         "PRIMARY": ["id"],
319                         "addr": ["addr(32)"],
320                         "url": ["UNIQUE", "url(190)"]
321                 }
322         },
323         "fsuggest": {
324                 "comment": "friend suggestion stuff",
325                 "fields": {
326                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": ""},
327                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
328                         "cid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": ""},
329                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
330                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
331                         "request": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
332                         "photo": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
333                         "note": {"type": "text", "comment": ""},
334                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""}
335                 },
336                 "indexes": {
337                         "PRIMARY": ["id"]
338                 }
339         },
340         "gcign": {
341                 "comment": "contacts ignored by friend suggestions",
342                 "fields": {
343                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
344                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Local User id"},
345                         "gcid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"gcontact": "id"}, "comment": "gcontact.id of ignored contact"}
346                 },
347                 "indexes": {
348                         "PRIMARY": ["id"],
349                         "uid": ["uid"],
350                         "gcid": ["gcid"]
351                 }
352         },
353         "gcontact": {
354                 "comment": "global contacts",
355                 "fields": {
356                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
357                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Name that this contact is known by"},
358                         "nick": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Nick- and user name of the contact"},
359                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Link to the contacts profile page"},
360                         "nurl": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
361                         "photo": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Link to the profile photo"},
362                         "connect": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
363                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
364                         "updated": {"type": "datetime", "default": "0001-01-01 00:00:00", "comment": ""},
365                         "last_contact": {"type": "datetime", "default": "0001-01-01 00:00:00", "comment": ""},
366                         "last_failure": {"type": "datetime", "default": "0001-01-01 00:00:00", "comment": ""},
367                         "location": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
368                         "about": {"type": "text", "comment": ""},
369                         "keywords": {"type": "text", "comment": "puplic keywords (interests)"},
370                         "gender": {"type": "varchar(32)", "not null": "1", "default": "", "comment": ""},
371                         "birthday": {"type": "varchar(32)", "not null": "1", "default": "0001-01-01", "comment": ""},
372                         "community": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 if contact is forum account"},
373                         "contact-type": {"type": "tinyint", "not null": "1", "default": "-1", "comment": ""},
374                         "hide": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 = should be hidden from search"},
375                         "nsfw": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 = contact posts nsfw content"},
376                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": "social network protocol"},
377                         "addr": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
378                         "notify": {"type": "varchar(255)", "comment": ""},
379                         "alias": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
380                         "generation": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
381                         "server_url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "baseurl of the contacts server"}
382                 },
383                 "indexes": {
384                         "PRIMARY": ["id"],
385                         "nurl": ["UNIQUE", "nurl(190)"],
386                         "name": ["name(64)"],
387                         "nick": ["nick(32)"],
388                         "addr": ["addr(64)"],
389                         "hide_network_updated": ["hide", "network", "updated"],
390                         "updated": ["updated"]
391                 }
392         },
393         "glink": {
394                 "comment": "'friends of friends' linkages derived from poco",
395                 "fields": {
396                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
397                         "cid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": ""},
398                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
399                         "gcid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"gcontact": "id"}, "comment": ""},
400                         "zcid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"gcontact": "id"}, "comment": ""},
401                         "updated": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""}
402                 },
403                 "indexes": {
404                         "PRIMARY": ["id"],
405                         "cid_uid_gcid_zcid": ["UNIQUE", "cid", "uid", "gcid", "zcid"],
406                         "gcid": ["gcid"]
407                 }
408         },
409         "group": {
410                 "comment": "privacy groups, group info",
411                 "fields": {
412                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
413                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
414                         "visible": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 indicates the member list is not private"},
415                         "deleted": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 indicates the group has been deleted"},
416                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "human readable name of group"}
417                 },
418                 "indexes": {
419                         "PRIMARY": ["id"],
420                         "uid": ["uid"]
421                 }
422         },
423         "group_member": {
424                 "comment": "privacy groups, member info",
425                 "fields": {
426                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
427                         "gid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"group": "id"}, "comment": "groups.id of the associated group"},
428                         "contact-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "contact.id of the member assigned to the associated group"}
429                 },
430                 "indexes": {
431                         "PRIMARY": ["id"],
432                         "contactid": ["contact-id"],
433                         "gid_contactid": ["UNIQUE", "gid", "contact-id"]
434                 }
435         },
436         "gserver": {
437                 "comment": "Global servers",
438                 "fields": {
439                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
440                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
441                         "nurl": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
442                         "version": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
443                         "site_name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
444                         "info": {"type": "text", "comment": ""},
445                         "register_policy": {"type": "tinyint", "not null": "1", "default": "0", "comment": ""},
446                         "registered-users": {"type": "int unsigned", "not null": "1", "default": "0", "comment": "Number of registered users"},
447                         "poco": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
448                         "noscrape": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
449                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": ""},
450                         "platform": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
451                         "relay-subscribe": {"type": "boolean", "not null": "1", "default": "0", "comment": "Has the server subscribed to the relay system"},
452                         "relay-scope": {"type": "varchar(10)", "not null": "1", "default": "", "comment": "The scope of messages that the server wants to get"},
453                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
454                         "last_poco_query": {"type": "datetime", "default": "0001-01-01 00:00:00", "comment": ""},
455                         "last_contact": {"type": "datetime", "default": "0001-01-01 00:00:00", "comment": ""},
456                         "last_failure": {"type": "datetime", "default": "0001-01-01 00:00:00", "comment": ""}
457                 },
458                 "indexes": {
459                         "PRIMARY": ["id"],
460                         "nurl": ["UNIQUE", "nurl(190)"]
461                 }
462         },
463         "gserver-tag": {
464                 "comment": "Tags that the server has subscribed",
465                 "fields": {
466                         "gserver-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"gserver": "id"}, "primary": "1", "comment": "The id of the gserver"},
467                         "tag": {"type": "varchar(100)", "not null": "1", "default": "", "primary": "1", "comment": "Tag that the server has subscribed"}
468                 },
469                 "indexes": {
470                         "PRIMARY": ["gserver-id", "tag"],
471                         "tag": ["tag"]
472                 }
473         },
474         "hook": {
475                 "comment": "addon hook registry",
476                 "fields": {
477                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
478                         "hook": {"type": "varbinary(100)", "not null": "1", "default": "", "comment": "name of hook"},
479                         "file": {"type": "varbinary(200)", "not null": "1", "default": "", "comment": "relative filename of hook handler"},
480                         "function": {"type": "varbinary(200)", "not null": "1", "default": "", "comment": "function name of hook handler"},
481                         "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"}
482                 },
483                 "indexes": {
484                         "PRIMARY": ["id"],
485                         "hook_file_function": ["UNIQUE", "hook", "file", "function"]
486                 }
487         },
488         "intro": {
489                 "comment": "",
490                 "fields": {
491                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
492                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
493                         "fid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"fcontact": "id"}, "comment": ""},
494                         "contact-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": ""},
495                         "knowyou": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
496                         "duplex": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
497                         "note": {"type": "text", "comment": ""},
498                         "hash": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
499                         "datetime": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
500                         "blocked": {"type": "boolean", "not null": "1", "default": "1", "comment": ""},
501                         "ignore": {"type": "boolean", "not null": "1", "default": "0", "comment": ""}
502                 },
503                 "indexes": {
504                         "PRIMARY": ["id"]
505                 }
506         },
507         "item": {
508                 "comment": "Structure for all posts",
509                 "fields": {
510                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "relation": {"thread": "iid"}},
511                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "A unique identifier for this item"},
512                         "uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
513                         "uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
514                         "uri-hash": {"type": "varchar(80)", "not null": "1", "default": "", "comment": "RIPEMD-128 hash from uri"},
515                         "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"},
516                         "parent-uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "uri of the parent to this item"},
517                         "parent-uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table that contains the parent uri"},
518                         "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"},
519                         "thr-parent-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table that contains the thread parent uri"},
520                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Creation timestamp."},
521                         "edited": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last edit (default is created)"},
522                         "commented": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last comment/reply to this item"},
523                         "received": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime"},
524                         "changed": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date that something in the conversation changed, indicating clients should fetch the conversation again"},
525                         "gravity": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
526                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": "Network from where the item comes from"},
527                         "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"},
528                         "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"},
529                         "icid": {"type": "int unsigned", "relation": {"item-content": "id"}, "comment": "Id of the item-content table entry that contains the whole item content"},
530                         "iaid": {"type": "int unsigned", "relation": {"item-activity": "id"}, "comment": "Id of the item-activity table entry that contains the activity data"},
531                         "extid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
532                         "post-type": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": "Post type (personal note, bookmark, ...)"},
533                         "global": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
534                         "private": {"type": "boolean", "not null": "1", "default": "0", "comment": "distribution is restricted"},
535                         "visible": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
536                         "moderated": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
537                         "deleted": {"type": "boolean", "not null": "1", "default": "0", "comment": "item has been deleted"},
538                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner id which owns this copy of the item"},
539                         "contact-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "contact.id"},
540                         "wall": {"type": "boolean", "not null": "1", "default": "0", "comment": "This item was posted to the wall of uid"},
541                         "origin": {"type": "boolean", "not null": "1", "default": "0", "comment": "item originated at this site"},
542                         "pubmail": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
543                         "starred": {"type": "boolean", "not null": "1", "default": "0", "comment": "item has been favourited"},
544                         "unseen": {"type": "boolean", "not null": "1", "default": "1", "comment": "item has not been seen"},
545                         "mention": {"type": "boolean", "not null": "1", "default": "0", "comment": "The owner of this item was mentioned in it"},
546                         "forum_mode": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
547                         "psid": {"type": "int unsigned", "relation": {"permissionset": "id"}, "comment": "ID of the permission set of this post"},
548                         "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"},
549                         "event-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"event": "id"}, "comment": "Used to link to the event.id"},
550                         "attach": {"type": "mediumtext", "comment": "JSON structure representing attachments to this item"},
551                         "allow_cid": {"type": "mediumtext", "comment": "Deprecated"},
552                         "allow_gid": {"type": "mediumtext", "comment": "Deprecated"},
553                         "deny_cid": {"type": "mediumtext", "comment": "Deprecated"},
554                         "deny_gid": {"type": "mediumtext", "comment": "Deprecated"},
555                         "postopts": {"type": "text", "comment": "Deprecated"},
556                         "inform": {"type": "mediumtext", "comment": "Deprecated"},
557                         "type": {"type": "varchar(20)", "comment": "Deprecated"},
558                         "bookmark": {"type": "boolean", "comment": "Deprecated"},
559                         "file": {"type": "mediumtext", "comment": "Deprecated"},
560                         "location": {"type": "varchar(255)", "comment": "Deprecated"},
561                         "coord": {"type": "varchar(255)", "comment": "Deprecated"},
562                         "tag": {"type": "mediumtext", "comment": "Deprecated"},
563                         "plink": {"type": "varchar(255)", "comment": "Deprecated"},
564                         "title": {"type": "varchar(255)", "comment": "Deprecated"},
565                         "content-warning": {"type": "varchar(255)", "comment": "Deprecated"},
566                         "body": {"type": "mediumtext", "comment": "Deprecated"},
567                         "app": {"type": "varchar(255)", "comment": "Deprecated"},
568                         "verb": {"type": "varchar(100)", "comment": "Deprecated"},
569                         "object-type": {"type": "varchar(100)", "comment": "Deprecated"},
570                         "object": {"type": "text", "comment": "Deprecated"},
571                         "target-type": {"type": "varchar(100)", "comment": "Deprecated"},
572                         "target": {"type": "text", "comment": "Deprecated"},
573                         "author-name": {"type": "varchar(255)", "comment": "Deprecated"},
574                         "author-link": {"type": "varchar(255)", "comment": "Deprecated"},
575                         "author-avatar": {"type": "varchar(255)", "comment": "Deprecated"},
576                         "owner-name": {"type": "varchar(255)", "comment": "Deprecated"},
577                         "owner-link": {"type": "varchar(255)", "comment": "Deprecated"},
578                         "owner-avatar": {"type": "varchar(255)", "comment": "Deprecated"},
579                         "rendered-hash": {"type": "varchar(32)", "comment": "Deprecated"},
580                         "rendered-html": {"type": "mediumtext", "comment": "Deprecated"}
581                 },
582                 "indexes": {
583                         "PRIMARY": ["id"],
584                         "guid": ["guid(191)"],
585                         "uri": ["uri(191)"],
586                         "parent": ["parent"],
587                         "parent-uri": ["parent-uri(191)"],
588                         "extid": ["extid(191)"],
589                         "uid_id": ["uid", "id"],
590                         "uid_contactid_id": ["uid", "contact-id", "id"],
591                         "uid_created": ["uid", "created"],
592                         "uid_commented": ["uid", "commented"],
593                         "uid_unseen_contactid": ["uid", "unseen", "contact-id"],
594                         "uid_network_received": ["uid", "network", "received"],
595                         "uid_network_commented": ["uid", "network", "commented"],
596                         "uid_thrparent": ["uid", "thr-parent(190)"],
597                         "uid_parenturi": ["uid", "parent-uri(190)"],
598                         "uid_contactid_created": ["uid", "contact-id", "created"],
599                         "authorid_created": ["author-id", "created"],
600                         "ownerid": ["owner-id"],
601                         "uid_uri": ["uid", "uri(190)"],
602                         "resource-id": ["resource-id"],
603                         "deleted_changed": ["deleted", "changed"],
604                         "uid_wall_changed": ["uid", "wall", "changed"],
605                         "uid_eventid": ["uid", "event-id"],
606                         "icid": ["icid"],
607                         "iaid": ["iaid"],
608                         "psid_wall": ["psid", "wall"]
609                 }
610         },
611         "item-activity": {
612                 "comment": "Activities for items",
613                 "fields": {
614                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "relation": {"thread": "iid"}},
615                         "uri": {"type": "varchar(255)", "comment": ""},
616                         "uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
617                         "uri-hash": {"type": "varchar(80)", "not null": "1", "default": "", "comment": "RIPEMD-128 hash from uri"},
618                         "activity": {"type": "smallint unsigned", "not null": "1", "default": "0", "comment": ""}
619                 },
620                 "indexes": {
621                         "PRIMARY": ["id"],
622                         "uri-hash": ["UNIQUE", "uri-hash"],
623                         "uri": ["uri(191)"],
624                         "uri-id": ["uri-id"]
625                 }
626         },
627         "item-content": {
628                 "comment": "Content for all posts",
629                 "fields": {
630                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "relation": {"thread": "iid"}},
631                         "uri": {"type": "varchar(255)", "comment": ""},
632                         "uri-id": {"type": "int unsigned", "relation": {"item-uri": "id"}, "comment": "Id of the item-uri table entry that contains the item uri"},
633                         "uri-plink-hash": {"type": "varchar(80)", "not null": "1", "default": "", "comment": "RIPEMD-128 hash from uri"},
634                         "title": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "item title"},
635                         "content-warning": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
636                         "body": {"type": "mediumtext", "comment": "item body content"},
637                         "location": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "text location where this item originated"},
638                         "coord": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "longitude/latitude pair representing location where this item originated"},
639                         "language": {"type": "text", "comment": "Language information about this post"},
640                         "app": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "application which generated this item"},
641                         "rendered-hash": {"type": "varchar(32)", "not null": "1", "default": "", "comment": ""},
642                         "rendered-html": {"type": "mediumtext", "comment": "item.body converted to html"},
643                         "object-type": {"type": "varchar(100)", "not null": "1", "default": "", "comment": "ActivityStreams object type"},
644                         "object": {"type": "text", "comment": "JSON encoded object structure unless it is an implied object (normal post)"},
645                         "target-type": {"type": "varchar(100)", "not null": "1", "default": "", "comment": "ActivityStreams target type if applicable (URI)"},
646                         "target": {"type": "text", "comment": "JSON encoded target structure if used"},
647                         "plink": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "permalink or URL to a displayable copy of the message at its source"},
648                         "verb": {"type": "varchar(100)", "not null": "1", "default": "", "comment": "ActivityStreams verb"}
649                 },
650                 "indexes": {
651                         "PRIMARY": ["id"],
652                         "uri-plink-hash": ["UNIQUE", "uri-plink-hash"],
653                         "uri": ["uri(191)"],
654                         "uri-id": ["uri-id"]
655                 }
656         },
657         "item-delivery-data": {
658                 "comment": "Delivery data for items",
659                 "fields": {
660                         "iid": {"type": "int unsigned", "not null": "1", "primary": "1", "relation": {"item": "id"}, "comment": "Item id"},
661                         "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"},
662                         "inform": {"type": "mediumtext", "comment": "Additional receivers of the linked item"}
663                 },
664                 "indexes": {
665                         "PRIMARY": ["iid"]
666                 }
667         },
668         "item-uri": {
669                 "comment": "URI and GUID for items",
670                 "fields": {
671                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1"},
672                         "uri": {"type": "varbinary(255)", "not null": "1", "comment": "URI of an item"},
673                         "guid": {"type": "varbinary(255)", "comment": "A unique identifier for an item"}
674                 },
675                 "indexes": {
676                         "PRIMARY": ["id"],
677                         "uri": ["UNIQUE", "uri"],
678                         "guid": ["guid"]
679                 }
680         },
681         "locks": {
682                 "comment": "",
683                 "fields": {
684                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
685                         "name": {"type": "varchar(128)", "not null": "1", "default": "", "comment": ""},
686                         "locked": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
687                         "pid": {"type": "int unsigned", "not null": "1", "default": "0", "comment": "Process ID"},
688                         "expires": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime of cache expiration"}
689                 },
690                 "indexes": {
691                         "PRIMARY": ["id"],
692                         "name_expires": ["name", "expires"]
693                 }
694         },
695         "mail": {
696                 "comment": "private messages",
697                 "fields": {
698                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
699                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
700                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "A unique identifier for this private message"},
701                         "from-name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "name of the sender"},
702                         "from-photo": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "contact photo link of the sender"},
703                         "from-url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "profile linke of the sender"},
704                         "contact-id": {"type": "varchar(255)", "not null": "1", "default": "", "relation": {"contact": "id"}, "comment": "contact.id"},
705                         "convid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"conv": "id"}, "comment": "conv.id"},
706                         "title": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
707                         "body": {"type": "mediumtext", "comment": ""},
708                         "seen": {"type": "boolean", "not null": "1", "default": "0", "comment": "if message visited it is 1"},
709                         "reply": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
710                         "replied": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
711                         "unknown": {"type": "boolean", "not null": "1", "default": "0", "comment": "if sender not in the contact table this is 1"},
712                         "uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
713                         "parent-uri": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
714                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "creation time of the private message"}
715                 },
716                 "indexes": {
717                         "PRIMARY": ["id"],
718                         "uid_seen": ["uid", "seen"],
719                         "convid": ["convid"],
720                         "uri": ["uri(64)"],
721                         "parent-uri": ["parent-uri(64)"],
722                         "contactid": ["contact-id(32)"]
723                 }
724         },
725         "mailacct": {
726                 "comment": "Mail account data for fetching mails",
727                 "fields": {
728                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
729                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
730                         "server": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
731                         "port": {"type": "smallint unsigned", "not null": "1", "default": "0", "comment": ""},
732                         "ssltype": {"type": "varchar(16)", "not null": "1", "default": "", "comment": ""},
733                         "mailbox": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
734                         "user": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
735                         "pass": {"type": "text", "comment": ""},
736                         "reply_to": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
737                         "action": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
738                         "movetofolder": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
739                         "pubmail": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
740                         "last_check": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""}
741                 },
742                 "indexes": {
743                         "PRIMARY": ["id"]
744                 }
745         },
746         "manage": {
747                 "comment": "table of accounts that can manage each other",
748                 "fields": {
749                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
750                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
751                         "mid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"}
752                 },
753                 "indexes": {
754                         "PRIMARY": ["id"],
755                         "uid_mid": ["UNIQUE", "uid", "mid"]
756                 }
757         },
758         "notify": {
759                 "comment": "notifications",
760                 "fields": {
761                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
762                         "hash": {"type": "varchar(64)", "not null": "1", "default": "", "comment": ""},
763                         "type": {"type": "smallint unsigned", "not null": "1", "default": "0", "comment": ""},
764                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
765                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
766                         "photo": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
767                         "date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
768                         "msg": {"type": "mediumtext", "comment": ""},
769                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
770                         "link": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
771                         "iid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"item": "id"}, "comment": "item.id"},
772                         "parent": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"item": "id"}, "comment": ""},
773                         "seen": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
774                         "verb": {"type": "varchar(100)", "not null": "1", "default": "", "comment": ""},
775                         "otype": {"type": "varchar(10)", "not null": "1", "default": "", "comment": ""},
776                         "name_cache": {"type": "tinytext", "comment": "Cached bbcode parsing of name"},
777                         "msg_cache": {"type": "mediumtext", "comment": "Cached bbcode parsing of msg"}
778                         },
779                 "indexes": {
780                         "PRIMARY": ["id"],
781                         "hash_uid": ["hash", "uid"],
782                         "seen_uid_date": ["seen", "uid", "date"],
783                         "uid_date": ["uid", "date"],
784                         "uid_type_link": ["uid", "type", "link(190)"]
785                 }
786         },
787         "notify-threads": {
788                 "comment": "",
789                 "fields": {
790                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
791                         "notify-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"notify": "id"}, "comment": ""},
792                         "master-parent-item": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"item": "id"}, "comment": ""},
793                         "parent-item": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""},
794                         "receiver-uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"}
795                 },
796                 "indexes": {
797                         "PRIMARY": ["id"]
798                 }
799         },
800         "oembed": {
801                 "comment": "cache for OEmbed queries",
802                 "fields": {
803                         "url": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "page url"},
804                         "maxwidth": {"type": "mediumint unsigned", "not null": "1", "primary": "1", "comment": "Maximum width passed to Oembed"},
805                         "content": {"type": "mediumtext", "comment": "OEmbed data of the page"},
806                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime of creation"}
807                 },
808                 "indexes": {
809                         "PRIMARY": ["url", "maxwidth"],
810                         "created": ["created"]
811                 }
812         },
813         "openwebauth-token": {
814                 "comment": "Store OpenWebAuth token to verify contacts",
815                 "fields": {
816                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
817                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
818                         "type": {"type": "varchar(32)", "not null": "1", "default": "", "comment": "Verify type"},
819                         "token": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "A generated token"},
820                         "meta": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
821                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime of creation"}
822                 },
823                 "indexes": {
824                         "PRIMARY": ["id"]
825                 }
826         },
827         "parsed_url": {
828                 "comment": "cache for 'parse_url' queries",
829                 "fields": {
830                         "url": {"type": "varbinary(255)", "not null": "1", "primary": "1", "comment": "page url"},
831                         "guessing": {"type": "boolean", "not null": "1", "default": "0", "primary": "1", "comment": "is the 'guessing' mode active?"},
832                         "oembed": {"type": "boolean", "not null": "1", "default": "0", "primary": "1", "comment": "is the data the result of oembed?"},
833                         "content": {"type": "mediumtext", "comment": "page data"},
834                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "datetime of creation"}
835                 },
836                 "indexes": {
837                         "PRIMARY": ["url", "guessing", "oembed"],
838                         "created": ["created"]
839                 }
840         },
841         "participation": {
842                 "comment": "Storage for participation messages from Diaspora",
843                 "fields": {
844                         "iid": {"type": "int unsigned", "not null": "1", "primary": "1", "relation": {"item": "id"}, "comment": ""},
845                         "server": {"type": "varchar(60)", "not null": "1", "primary": "1", "comment": ""},
846                         "cid": {"type": "int unsigned", "not null": "1", "relation": {"contact": "id"}, "comment": ""},
847                         "fid": {"type": "int unsigned", "not null": "1", "relation": {"fcontact": "id"}, "comment": ""}
848                 },
849                 "indexes": {
850                         "PRIMARY": ["iid", "server"]
851                         }
852                 },
853         "pconfig": {
854                 "comment": "personal (per user) configuration storage",
855                 "fields": {
856                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": ""},
857                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
858                         "cat": {"type": "varbinary(50)", "not null": "1", "default": "", "comment": ""},
859                         "k": {"type": "varbinary(100)", "not null": "1", "default": "", "comment": ""},
860                         "v": {"type": "mediumtext", "comment": ""}
861                 },
862                 "indexes": {
863                         "PRIMARY": ["id"],
864                         "uid_cat_k": ["UNIQUE", "uid", "cat", "k"]
865                 }
866         },
867         "permissionset": {
868                 "comment": "",
869                 "fields": {
870                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
871                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner id of this permission set"},
872                         "allow_cid": {"type": "mediumtext", "comment": "Access Control - list of allowed contact.id '<19><78>'"},
873                         "allow_gid": {"type": "mediumtext", "comment": "Access Control - list of allowed groups"},
874                         "deny_cid": {"type": "mediumtext", "comment": "Access Control - list of denied contact.id"},
875                         "deny_gid": {"type": "mediumtext", "comment": "Access Control - list of denied groups"}
876                 },
877                 "indexes": {
878                         "PRIMARY": ["id"],
879                         "uid_allow_cid_allow_gid_deny_cid_deny_gid": ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"]
880                 }
881         },
882         "photo": {
883                 "comment": "photo storage",
884                 "fields": {
885                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
886                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
887                         "contact-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "contact.id"},
888                         "guid": {"type": "char(16)", "not null": "1", "default": "", "comment": "A unique identifier for this photo"},
889                         "resource-id": {"type": "char(32)", "not null": "1", "default": "", "comment": ""},
890                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "creation date"},
891                         "edited": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "last edited date"},
892                         "title": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
893                         "desc": {"type": "text", "comment": ""},
894                         "album": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "The name of the album to which the photo belongs"},
895                         "filename": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
896                         "type": {"type": "varchar(30)", "not null": "1", "default": "image/jpeg"},
897                         "height": {"type": "smallint unsigned", "not null": "1", "default": "0", "comment": ""},
898                         "width": {"type": "smallint unsigned", "not null": "1", "default": "0", "comment": ""},
899                         "datasize": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""},
900                         "data": {"type": "mediumblob", "not null": "1", "comment": ""},
901                         "scale": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
902                         "profile": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
903                         "allow_cid": {"type": "mediumtext", "comment": "Access Control - list of allowed contact.id '<19><78>'"},
904                         "allow_gid": {"type": "mediumtext", "comment": "Access Control - list of allowed groups"},
905                         "deny_cid": {"type": "mediumtext", "comment": "Access Control - list of denied contact.id"},
906                         "deny_gid": {"type": "mediumtext", "comment": "Access Control - list of denied groups"}
907                 },
908                 "indexes": {
909                         "PRIMARY": ["id"],
910                         "contactid": ["contact-id"],
911                         "uid_contactid": ["uid", "contact-id"],
912                         "uid_profile": ["uid", "profile"],
913                         "uid_album_scale_created": ["uid", "album(32)", "scale", "created"],
914                         "uid_album_resource-id_created": ["uid", "album(32)", "resource-id", "created"],
915                         "resource-id": ["resource-id"]
916                 }
917         },
918         "poll": {
919                 "comment": "Currently unused table for storing poll results",
920                 "fields": {
921                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": ""},
922                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
923                         "q0": {"type": "text", "comment": ""},
924                         "q1": {"type": "text", "comment": ""},
925                         "q2": {"type": "text", "comment": ""},
926                         "q3": {"type": "text", "comment": ""},
927                         "q4": {"type": "text", "comment": ""},
928                         "q5": {"type": "text", "comment": ""},
929                         "q6": {"type": "text", "comment": ""},
930                         "q7": {"type": "text", "comment": ""},
931                         "q8": {"type": "text", "comment": ""},
932                         "q9": {"type": "text", "comment": ""}
933                 },
934                 "indexes": {
935                         "PRIMARY": ["id"],
936                         "uid": ["uid"]
937                 }
938         },
939         "poll_result": {
940                 "comment": "data for polls - currently unused",
941                 "fields": {
942                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
943                         "poll_id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"poll": "id"}},
944                         "choice": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""}
945                 },
946                 "indexes": {
947                         "PRIMARY": ["id"],
948                         "poll_id": ["poll_id"]
949                 }
950         },
951         "process": {
952                 "comment": "Currently running system processes",
953                 "fields": {
954                         "pid": {"type": "int unsigned", "not null": "1", "primary": "1", "comment": ""},
955                         "command": {"type": "varbinary(32)", "not null": "1", "default": "", "comment": ""},
956                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""}
957                 },
958                 "indexes": {
959                         "PRIMARY": ["pid"],
960                         "command": ["command"]
961                 }
962         },
963         "profile": {
964                 "comment": "user profiles data",
965                 "fields": {
966                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
967                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "Owner User id"},
968                         "profile-name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Name of the profile"},
969                         "is-default": {"type": "boolean", "not null": "1", "default": "0", "comment": "Mark this profile as default profile"},
970                         "hide-friends": {"type": "boolean", "not null": "1", "default": "0", "comment": "Hide friend list from viewers of this profile"},
971                         "name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
972                         "pdesc": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Title or description"},
973                         "dob": {"type": "varchar(32)", "not null": "1", "default": "0000-00-00", "comment": "Day of birth"},
974                         "address": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
975                         "locality": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
976                         "region": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
977                         "postal-code": {"type": "varchar(32)", "not null": "1", "default": "", "comment": ""},
978                         "country-name": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
979                         "hometown": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
980                         "gender": {"type": "varchar(32)", "not null": "1", "default": "", "comment": ""},
981                         "marital": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
982                         "with": {"type": "text", "comment": ""},
983                         "howlong": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
984                         "sexual": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
985                         "politic": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
986                         "religion": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
987                         "pub_keywords": {"type": "text", "comment": ""},
988                         "prv_keywords": {"type": "text", "comment": ""},
989                         "likes": {"type": "text", "comment": ""},
990                         "dislikes": {"type": "text", "comment": ""},
991                         "about": {"type": "text", "comment": ""},
992                         "summary": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
993                         "music": {"type": "text", "comment": ""},
994                         "book": {"type": "text", "comment": ""},
995                         "tv": {"type": "text", "comment": ""},
996                         "film": {"type": "text", "comment": ""},
997                         "interest": {"type": "text", "comment": ""},
998                         "romance": {"type": "text", "comment": ""},
999                         "work": {"type": "text", "comment": ""},
1000                         "education": {"type": "text", "comment": ""},
1001                         "contact": {"type": "text", "comment": ""},
1002                         "homepage": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1003                         "xmpp": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1004                         "photo": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1005                         "thumb": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1006                         "publish": {"type": "boolean", "not null": "1", "default": "0", "comment": "publish default profile in local directory"},
1007                         "net-publish": {"type": "boolean", "not null": "1", "default": "0", "comment": "publish profile in global directory"}
1008                 },
1009                 "indexes": {
1010                         "PRIMARY": ["id"],
1011                         "uid_is-default": ["uid", "is-default"]
1012                 }
1013         },
1014         "profile_check": {
1015                 "comment": "DFRN remote auth use",
1016                 "fields": {
1017                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1018                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
1019                         "cid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "contact.id"},
1020                         "dfrn_id": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1021                         "sec": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1022                         "expire": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""}
1023                 },
1024                 "indexes": {
1025                         "PRIMARY": ["id"]
1026                 }
1027         },
1028         "push_subscriber": {
1029                 "comment": "Used for OStatus: Contains feed subscribers",
1030                 "fields": {
1031                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1032                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
1033                         "callback_url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1034                         "topic": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1035                         "nickname": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1036                         "push": {"type": "tinyint", "not null": "1", "default": "0", "comment": "Retrial counter"},
1037                         "last_update": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last successful trial"},
1038                         "next_try": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Next retrial date"},
1039                         "renewed": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last subscription renewal"},
1040                         "secret": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""}
1041                 },
1042                 "indexes": {
1043                         "PRIMARY": ["id"],
1044                         "next_try": ["next_try"]
1045                 }
1046         },
1047         "queue": {
1048                 "comment": "Queue for messages that couldn't be delivered",
1049                 "fields": {
1050                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1051                         "cid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "Message receiver"},
1052                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": "Receiver's network"},
1053                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Unique GUID of the message"},
1054                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date, when the message was created"},
1055                         "last": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Date of last trial"},
1056                         "next": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Next retrial date"},
1057                         "retrial": {"type": "tinyint", "not null": "1", "default": "0", "comment": "Retrial counter"},
1058                         "content": {"type": "mediumtext", "comment": ""},
1059                         "batch": {"type": "boolean", "not null": "1", "default": "0", "comment": ""}
1060                 },
1061                 "indexes": {
1062                         "PRIMARY": ["id"],
1063                         "last": ["last"],
1064                         "next": ["next"]
1065                 }
1066         },
1067         "register": {
1068                 "comment": "registrations requiring admin approval",
1069                 "fields": {
1070                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1071                         "hash": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1072                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1073                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
1074                         "password": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1075                         "language": {"type": "varchar(16)", "not null": "1", "default": "", "comment": ""},
1076                         "note": {"type": "text", "comment": ""}
1077                 },
1078                 "indexes": {
1079                         "PRIMARY": ["id"]
1080                 }
1081         },
1082         "search": {
1083                 "comment": "",
1084                 "fields": {
1085                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1086                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
1087                         "term": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""}
1088                 },
1089                 "indexes": {
1090                         "PRIMARY": ["id"],
1091                         "uid": ["uid"]
1092                 }
1093         },
1094         "session": {
1095                 "comment": "web session storage",
1096                 "fields": {
1097                         "id": {"type": "bigint unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1098                         "sid": {"type": "varbinary(255)", "not null": "1", "default": "", "comment": ""},
1099                         "data": {"type": "text", "comment": ""},
1100                         "expire": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""}
1101                 },
1102                 "indexes": {
1103                         "PRIMARY": ["id"],
1104                         "sid": ["sid(64)"],
1105                         "expire": ["expire"]
1106                 }
1107         },
1108         "sign": {
1109                 "comment": "Diaspora signatures",
1110                 "fields": {
1111                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1112                         "iid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"item": "id"}, "comment": "item.id"},
1113                         "signed_text": {"type": "mediumtext", "comment": ""},
1114                         "signature": {"type": "text", "comment": ""},
1115                         "signer": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""}
1116                 },
1117                 "indexes": {
1118                         "PRIMARY": ["id"],
1119                         "iid": ["UNIQUE", "iid"]
1120                 }
1121         },
1122         "term": {
1123                 "comment": "item taxonomy (categories, tags, etc.) table",
1124                 "fields": {
1125                         "tid": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": ""},
1126                         "oid": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"item": "id"}, "comment": ""},
1127                         "otype": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
1128                         "type": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
1129                         "term": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1130                         "url": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1131                         "guid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1132                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1133                         "received": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1134                         "global": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1135                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"}
1136                 },
1137                 "indexes": {
1138                         "PRIMARY": ["tid"],
1139                         "oid_otype_type_term": ["oid", "otype", "type", "term(32)"],
1140                         "uid_otype_type_term_global_created": ["uid", "otype", "type", "term(32)", "global", "created"],
1141                         "uid_otype_type_url": ["uid", "otype", "type", "url(64)"],
1142                         "guid": ["guid(64)"]
1143                 }
1144         },
1145         "thread": {
1146                 "comment": "Thread related data",
1147                 "fields": {
1148                         "iid": {"type": "int unsigned", "not null": "1", "default": "0", "primary": "1", "relation": {"item": "id"}, "comment": "sequential ID"},
1149                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"},
1150                         "contact-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": ""},
1151                         "owner-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "Item owner"},
1152                         "author-id": {"type": "int unsigned", "not null": "1", "default": "0", "relation": {"contact": "id"}, "comment": "Item author"},
1153                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1154                         "edited": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1155                         "commented": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1156                         "received": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1157                         "changed": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": ""},
1158                         "wall": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1159                         "private": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1160                         "pubmail": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1161                         "moderated": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1162                         "visible": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1163                         "starred": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1164                         "ignored": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1165                         "post-type": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": "Post type (personal note, bookmark, ...)"},
1166                         "unseen": {"type": "boolean", "not null": "1", "default": "1", "comment": ""},
1167                         "deleted": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1168                         "origin": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1169                         "forum_mode": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
1170                         "mention": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1171                         "network": {"type": "char(4)", "not null": "1", "default": "", "comment": ""},
1172                         "bookmark": {"type": "boolean", "comment": ""}
1173                 },
1174                 "indexes": {
1175                         "PRIMARY": ["iid"],
1176                         "uid_network_commented": ["uid", "network", "commented"],
1177                         "uid_network_created": ["uid", "network", "created"],
1178                         "uid_contactid_commented": ["uid", "contact-id", "commented"],
1179                         "uid_contactid_created": ["uid", "contact-id", "created"],
1180                         "contactid": ["contact-id"],
1181                         "ownerid": ["owner-id"],
1182                         "authorid": ["author-id"],
1183                         "uid_created": ["uid", "created"],
1184                         "uid_commented": ["uid", "commented"],
1185                         "uid_wall_created": ["uid", "wall", "created"],
1186                         "private_wall_origin_commented": ["private", "wall", "origin", "commented"]
1187                 }
1188         },
1189         "tokens": {
1190                 "comment": "OAuth usage",
1191                 "fields": {
1192                         "id": {"type": "varchar(40)", "not null": "1", "primary": "1", "comment": ""},
1193                         "secret": {"type": "text", "comment": ""},
1194                         "client_id": {"type": "varchar(20)", "not null": "1", "default": "", "relation": {"clients": "client_id"}},
1195                         "expires": {"type": "int", "not null": "1", "default": "0", "comment": ""},
1196                         "scope": {"type": "varchar(200)", "not null": "1", "default": "", "comment": ""},
1197                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "User id"}
1198                 },
1199                 "indexes": {
1200                         "PRIMARY": ["id"]
1201                 }
1202         },
1203         "user": {
1204                 "comment": "The local users",
1205                 "fields": {
1206                         "uid": {"type": "mediumint unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1207                         "parent-uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "relation": {"user": "uid"}, "comment": "The parent user that has full control about this user"},
1208                         "guid": {"type": "varchar(64)", "not null": "1", "default": "", "comment": "A unique identifier for this user"},
1209                         "username": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Name that this user is known by"},
1210                         "password": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "encrypted password"},
1211                         "legacy_password": {"type": "boolean", "not null": "1", "default": "0", "comment": "Is the password hash double-hashed?"},
1212                         "nickname": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "nick- and user name"},
1213                         "email": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "the users email address"},
1214                         "openid": {"type": "varchar(255)", "not null": "1", "default": "", "comment": ""},
1215                         "timezone": {"type": "varchar(128)", "not null": "1", "default": "", "comment": "PHP-legal timezone"},
1216                         "language": {"type": "varchar(32)", "not null": "1", "default": "en", "comment": "default language"},
1217                         "register_date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "timestamp of registration"},
1218                         "login_date": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "timestamp of last login"},
1219                         "default-location": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "Default for item.location"},
1220                         "allow_location": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 allows to display the location"},
1221                         "theme": {"type": "varchar(255)", "not null": "1", "default": "", "comment": "user theme preference"},
1222                         "pubkey": {"type": "text", "comment": "RSA public key 4096 bit"},
1223                         "prvkey": {"type": "text", "comment": "RSA private key 4096 bit"},
1224                         "spubkey": {"type": "text", "comment": ""},
1225                         "sprvkey": {"type": "text", "comment": ""},
1226                         "verified": {"type": "boolean", "not null": "1", "default": "0", "comment": "user is verified through email"},
1227                         "blocked": {"type": "boolean", "not null": "1", "default": "0", "comment": "1 for user is blocked"},
1228                         "blockwall": {"type": "boolean", "not null": "1", "default": "0", "comment": "Prohibit contacts to post to the profile page of the user"},
1229                         "hidewall": {"type": "boolean", "not null": "1", "default": "0", "comment": "Hide profile details from unkown viewers"},
1230                         "blocktags": {"type": "boolean", "not null": "1", "default": "0", "comment": "Prohibit contacts to tag the post of this user"},
1231                         "unkmail": {"type": "boolean", "not null": "1", "default": "0", "comment": "Permit unknown people to send private mails to this user"},
1232                         "cntunkmail": {"type": "int unsigned", "not null": "1", "default": "10", "comment": ""},
1233                         "notify-flags": {"type": "smallint unsigned", "not null": "1", "default": "65535", "comment": "email notification options"},
1234                         "page-flags": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": "page/profile type"},
1235                         "account-type": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": ""},
1236                         "prvnets": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1237                         "pwdreset": {"type": "varchar(255)", "comment": "Password reset request token"},
1238                         "pwdreset_time": {"type": "datetime", "comment": "Timestamp of the last password reset request"},
1239                         "maxreq": {"type": "int unsigned", "not null": "1", "default": "10", "comment": ""},
1240                         "expire": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""},
1241                         "account_removed": {"type": "boolean", "not null": "1", "default": "0", "comment": "if 1 the account is removed"},
1242                         "account_expired": {"type": "boolean", "not null": "1", "default": "0", "comment": ""},
1243                         "account_expires_on": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "timestamp when account expires and will be deleted"},
1244                         "expire_notification_sent": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "timestamp of last warning of account expiration"},
1245                         "def_gid": {"type": "int unsigned", "not null": "1", "default": "0", "comment": ""},
1246                         "allow_cid": {"type": "mediumtext", "comment": "default permission for this user"},
1247                         "allow_gid": {"type": "mediumtext", "comment": "default permission for this user"},
1248                         "deny_cid": {"type": "mediumtext", "comment": "default permission for this user"},
1249                         "deny_gid": {"type": "mediumtext", "comment": "default permission for this user"},
1250                         "openidserver": {"type": "text", "comment": ""}
1251                 },
1252                 "indexes": {
1253                         "PRIMARY": ["uid"],
1254                         "nickname": ["nickname(32)"]
1255                 }
1256         },
1257         "userd": {
1258                 "comment": "Deleted usernames",
1259                 "fields": {
1260                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "sequential ID"},
1261                         "username": {"type": "varchar(255)", "not null": "1", "comment": ""}
1262                 },
1263                 "indexes": {
1264                         "PRIMARY": ["id"],
1265                         "username": ["username(32)"]
1266                 }
1267         },
1268         "user-contact": {
1269                 "comment": "User specific public contact data",
1270                 "fields": {
1271                         "cid": {"type": "int unsigned", "not null": "1", "default": "0", "primary": "1", "relation": {"contact": "id"}, "comment": "Contact id of the linked public contact"},
1272                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "primary": "1", "relation": {"user": "uid"}, "comment": "User id"},
1273                         "blocked": {"type": "boolean", "comment": "Contact is completely blocked for this user"},
1274                         "ignored": {"type": "boolean", "comment": "Posts from this contact are ignored"},
1275                         "collapsed": {"type": "boolean", "comment": "Posts from this contact are collapsed"}
1276                 },
1277                 "indexes": {
1278                         "PRIMARY": ["uid", "cid"]
1279                 }
1280         },
1281         "user-item": {
1282                 "comment": "User specific item data",
1283                 "fields": {
1284                         "iid": {"type": "int unsigned", "not null": "1", "default": "0", "primary": "1", "relation": {"item": "id"}, "comment": "Item id"},
1285                         "uid": {"type": "mediumint unsigned", "not null": "1", "default": "0", "primary": "1", "relation": {"user": "uid"}, "comment": "User id"},
1286                         "hidden": {"type": "boolean", "not null": "1", "default": "0", "comment": "Marker to hide an item from the user"},
1287                         "ignored": {"type": "boolean", "comment": "Ignore this thread if set"}
1288                 },
1289                 "indexes": {
1290                         "PRIMARY": ["uid", "iid"]
1291                 }
1292         },
1293         "worker-ipc": {
1294                 "comment": "Inter process communication between the frontend and the worker",
1295                 "fields": {
1296                         "key": {"type": "int", "not null": "1", "primary": "1", "comment": ""},
1297                         "jobs": {"type": "boolean", "comment": "Flag for outstanding jobs"}
1298                 },
1299                 "indexes": {
1300                         "PRIMARY": ["key"]
1301                 },
1302                 "engine": "MEMORY"
1303         },
1304         "workerqueue": {
1305                 "comment": "Background tasks queue entries",
1306                 "fields": {
1307                         "id": {"type": "int unsigned", "not null": "1", "extra": "auto_increment", "primary": "1", "comment": "Auto incremented worker task id"},
1308                         "parameter": {"type": "mediumblob", "comment": "Task command"},
1309                         "priority": {"type": "tinyint unsigned", "not null": "1", "default": "0", "comment": "Task priority"},
1310                         "created": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Creation date"},
1311                         "pid": {"type": "int unsigned", "not null": "1", "default": "0", "comment": "Process id of the worker"},
1312                         "executed": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Execution date"},
1313                         "next_try": {"type": "datetime", "not null": "1", "default": "0001-01-01 00:00:00", "comment": "Next retrial date"},
1314                         "retrial": {"type": "tinyint", "not null": "1", "default": "0", "comment": "Retrial counter"},
1315                         "done": {"type": "boolean", "not null": "1", "default": "0", "comment": "Marked 1 when the task was done - will be deleted later"}
1316                 },
1317                 "indexes": {
1318                         "PRIMARY": ["id"],
1319                         "pid": ["pid"],
1320                         "parameter": ["parameter(64)"],
1321                         "priority_created_next_try": ["priority", "created", "next_try"],
1322                         "done_executed_next_try": ["done", "executed", "next_try"]
1323                 }
1324         }
1325 }