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