Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there)
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.

dbstructure.config.php 91KB

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