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