Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1439 lines
92KB

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