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