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