core.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <database>
  3. <table>
  4. <!--
  5. Namespaced Key-Value Store for Application Configuration.
  6. - Keys are namespaced per appid.
  7. - E.g. (core, global_cache_gc_lastrun) -> 1385463286
  8. -->
  9. <name>*dbprefix*appconfig</name>
  10. <declaration>
  11. <field>
  12. <name>appid</name>
  13. <type>text</type>
  14. <default></default>
  15. <notnull>true</notnull>
  16. <length>32</length>
  17. </field>
  18. <field>
  19. <name>configkey</name>
  20. <type>text</type>
  21. <default></default>
  22. <notnull>true</notnull>
  23. <length>64</length>
  24. </field>
  25. <field>
  26. <name>configvalue</name>
  27. <type>clob</type>
  28. <notnull>false</notnull>
  29. </field>
  30. </declaration>
  31. </table>
  32. <table>
  33. <!--
  34. Bidirectional Map for Storage Names and Storage Ids.
  35. - Assigns each storage name a unique storage id integer.
  36. - Long storage names are hashed.
  37. - E.g. local::/tmp/ <-> 2
  38. - E.g. b5db994aa8c6625100e418406c798269 <-> 27
  39. -->
  40. <name>*dbprefix*storages</name>
  41. <declaration>
  42. <field>
  43. <name>id</name>
  44. <type>text</type>
  45. <default></default>
  46. <notnull>false</notnull>
  47. <length>64</length>
  48. </field>
  49. <field>
  50. <name>numeric_id</name>
  51. <type>integer</type>
  52. <default>0</default>
  53. <notnull>true</notnull>
  54. <autoincrement>1</autoincrement>
  55. <length>4</length>
  56. </field>
  57. <field>
  58. <name>available</name>
  59. <type>integer</type>
  60. <default>1</default>
  61. <notnull>true</notnull>
  62. </field>
  63. <field>
  64. <name>last_checked</name>
  65. <type>integer</type>
  66. </field>
  67. </declaration>
  68. </table>
  69. <!-- a list of all mounted storage per user, populated on filesystem setup -->
  70. <table>
  71. <name>*dbprefix*mounts</name>
  72. <declaration>
  73. <field>
  74. <name>id</name>
  75. <type>integer</type>
  76. <default>0</default>
  77. <notnull>true</notnull>
  78. <autoincrement>1</autoincrement>
  79. <length>4</length>
  80. </field>
  81. <field>
  82. <name>storage_id</name>
  83. <type>integer</type>
  84. <notnull>true</notnull>
  85. </field>
  86. <!-- fileid of the root of the mount, foreign key: oc_filecache.fileid -->
  87. <field>
  88. <name>root_id</name>
  89. <type>integer</type>
  90. <notnull>true</notnull>
  91. </field>
  92. <field>
  93. <name>user_id</name>
  94. <type>text</type>
  95. <notnull>true</notnull>
  96. <length>64</length>
  97. </field>
  98. <field>
  99. <name>mount_point</name>
  100. <type>text</type>
  101. <notnull>true</notnull>
  102. <length>4000</length>
  103. </field>
  104. </declaration>
  105. </table>
  106. <table>
  107. <!--
  108. Bidirectional Map for Mimetypes and Mimetype Id
  109. - Assigns each mimetype (and supertype) a unique mimetype id integer.
  110. - E.g. application <-> 5
  111. - E.g. application/pdf <-> 6
  112. -->
  113. <name>*dbprefix*mimetypes</name>
  114. <declaration>
  115. <field>
  116. <name>id</name>
  117. <type>integer</type>
  118. <default>0</default>
  119. <notnull>true</notnull>
  120. <autoincrement>1</autoincrement>
  121. <length>4</length>
  122. </field>
  123. <field>
  124. <name>mimetype</name>
  125. <type>text</type>
  126. <default></default>
  127. <notnull>true</notnull>
  128. <length>255</length>
  129. </field>
  130. </declaration>
  131. </table>
  132. <table>
  133. <!--
  134. Main file table containing one row for each directory and file.
  135. - Assigns a unique integer fileid to each file (and directory)
  136. - Assigns an etag to each file (and directory)
  137. - Caches various file/dir properties such as:
  138. - path (filename, e.g. files/combinatoricslib-2.0_doc.zip)
  139. - path_hash = md5(path)
  140. - name (basename, e.g. combinatoricslib-2.0_doc.zip)
  141. - size (for directories this is the sum of all contained file sizes)
  142. -->
  143. <name>*dbprefix*filecache</name>
  144. <declaration>
  145. <field>
  146. <name>fileid</name>
  147. <type>integer</type>
  148. <default>0</default>
  149. <notnull>true</notnull>
  150. <autoincrement>1</autoincrement>
  151. <length>4</length>
  152. </field>
  153. <!-- Foreign Key storages::numeric_id -->
  154. <field>
  155. <name>storage</name>
  156. <type>integer</type>
  157. <default></default>
  158. <notnull>true</notnull>
  159. <length>4</length>
  160. </field>
  161. <field>
  162. <name>path</name>
  163. <type>text</type>
  164. <default></default>
  165. <notnull>false</notnull>
  166. <length>4000</length>
  167. </field>
  168. <field>
  169. <name>path_hash</name>
  170. <type>text</type>
  171. <default></default>
  172. <notnull>true</notnull>
  173. <length>32</length>
  174. </field>
  175. <!-- Foreign Key filecache::fileid -->
  176. <field>
  177. <name>parent</name>
  178. <type>integer</type>
  179. <default></default>
  180. <notnull>true</notnull>
  181. <length>4</length>
  182. </field>
  183. <field>
  184. <name>name</name>
  185. <type>text</type>
  186. <default></default>
  187. <notnull>false</notnull>
  188. <length>250</length>
  189. </field>
  190. <!-- Foreign Key mimetypes::id -->
  191. <field>
  192. <name>mimetype</name>
  193. <type>integer</type>
  194. <default></default>
  195. <notnull>true</notnull>
  196. <length>4</length>
  197. </field>
  198. <!-- Foreign Key mimetypes::id -->
  199. <field>
  200. <name>mimepart</name>
  201. <type>integer</type>
  202. <default></default>
  203. <notnull>true</notnull>
  204. <length>4</length>
  205. </field>
  206. <field>
  207. <name>size</name>
  208. <type>integer</type>
  209. <default></default>
  210. <notnull>true</notnull>
  211. <length>8</length>
  212. </field>
  213. <field>
  214. <name>mtime</name>
  215. <type>integer</type>
  216. <default></default>
  217. <notnull>true</notnull>
  218. <length>4</length>
  219. </field>
  220. <field>
  221. <name>storage_mtime</name>
  222. <type>integer</type>
  223. <default></default>
  224. <notnull>true</notnull>
  225. <length>4</length>
  226. </field>
  227. <field>
  228. <name>encrypted</name>
  229. <type>integer</type>
  230. <default>0</default>
  231. <notnull>true</notnull>
  232. <length>4</length>
  233. </field>
  234. <field>
  235. <name>unencrypted_size</name>
  236. <type>integer</type>
  237. <default>0</default>
  238. <notnull>true</notnull>
  239. <length>8</length>
  240. </field>
  241. <field>
  242. <name>etag</name>
  243. <type>text</type>
  244. <default></default>
  245. <notnull>false</notnull>
  246. <length>40</length>
  247. </field>
  248. <field>
  249. <name>permissions</name>
  250. <type>integer</type>
  251. <default>0</default>
  252. <notnull>false</notnull>
  253. <length>4</length>
  254. </field>
  255. <field>
  256. <name>checksum</name>
  257. <type>text</type>
  258. <default></default>
  259. <notnull>false</notnull>
  260. <length>255</length>
  261. </field>
  262. </declaration>
  263. </table>
  264. <table>
  265. <!--
  266. Stores which groups have which users as members in an n:m relationship.
  267. - Maps group id (gid) to a set of users (uid)
  268. - Maps user id (uid) to a set of groups (gid) (but without index)
  269. -->
  270. <name>*dbprefix*group_user</name>
  271. <declaration>
  272. <!-- Foreign Key groups::gid -->
  273. <field>
  274. <name>gid</name>
  275. <type>text</type>
  276. <default></default>
  277. <notnull>true</notnull>
  278. <length>64</length>
  279. </field>
  280. <!-- Foreign Key users::uid -->
  281. <field>
  282. <name>uid</name>
  283. <type>text</type>
  284. <default></default>
  285. <notnull>true</notnull>
  286. <length>64</length>
  287. </field>
  288. </declaration>
  289. </table>
  290. <table>
  291. <!--
  292. Stores which groups have which users as admins in an n:m relationship.
  293. - Maps group id (gid) to a set of users (uid)
  294. - Maps user id (uid) to a set of groups (gid)
  295. NOTE: This could (very likely) be reduced to a single bit in group_user
  296. instead of repeating varchars gid and uid here
  297. -->
  298. <name>*dbprefix*group_admin</name>
  299. <declaration>
  300. <!-- Foreign Key groups::gid -->
  301. <field>
  302. <name>gid</name>
  303. <type>text</type>
  304. <default></default>
  305. <notnull>true</notnull>
  306. <length>64</length>
  307. </field>
  308. <!-- Foreign Key users::uid -->
  309. <field>
  310. <name>uid</name>
  311. <type>text</type>
  312. <default></default>
  313. <notnull>true</notnull>
  314. <length>64</length>
  315. </field>
  316. </declaration>
  317. </table>
  318. <table>
  319. <!--
  320. A simple list of groups.
  321. -->
  322. <name>*dbprefix*groups</name>
  323. <declaration>
  324. <field>
  325. <name>gid</name>
  326. <type>text</type>
  327. <default></default>
  328. <notnull>true</notnull>
  329. <length>64</length>
  330. </field>
  331. </declaration>
  332. </table>
  333. <table>
  334. <!--
  335. Namespaced Key-Value Store for User Preferences
  336. - Keys are namespaced per userid and appid.
  337. - E.g. (admin, files, cache_version) -> 5
  338. -->
  339. <name>*dbprefix*preferences</name>
  340. <declaration>
  341. <!-- Foreign Key users::uid -->
  342. <field>
  343. <name>userid</name>
  344. <type>text</type>
  345. <default></default>
  346. <notnull>true</notnull>
  347. <length>64</length>
  348. </field>
  349. <field>
  350. <name>appid</name>
  351. <type>text</type>
  352. <default></default>
  353. <notnull>true</notnull>
  354. <length>32</length>
  355. </field>
  356. <field>
  357. <name>configkey</name>
  358. <type>text</type>
  359. <default></default>
  360. <notnull>true</notnull>
  361. <length>64</length>
  362. </field>
  363. <field>
  364. <name>configvalue</name>
  365. <type>clob</type>
  366. <notnull>false</notnull>
  367. </field>
  368. </declaration>
  369. </table>
  370. <table>
  371. <!--
  372. WebDAV properties.
  373. -->
  374. <name>*dbprefix*properties</name>
  375. <declaration>
  376. <field>
  377. <name>id</name>
  378. <autoincrement>1</autoincrement>
  379. <type>integer</type>
  380. <default>0</default>
  381. <notnull>true</notnull>
  382. <length>4</length>
  383. </field>
  384. <!-- Foreign Key users::uid -->
  385. <field>
  386. <name>userid</name>
  387. <type>text</type>
  388. <default></default>
  389. <notnull>true</notnull>
  390. <length>64</length>
  391. </field>
  392. <field>
  393. <name>propertypath</name>
  394. <type>text</type>
  395. <default></default>
  396. <notnull>true</notnull>
  397. <length>255</length>
  398. </field>
  399. <field>
  400. <name>propertyname</name>
  401. <type>text</type>
  402. <default></default>
  403. <notnull>true</notnull>
  404. <length>255</length>
  405. </field>
  406. <field>
  407. <name>propertyvalue</name>
  408. <type>text</type>
  409. <notnull>true</notnull>
  410. <length>255</length>
  411. </field>
  412. </declaration>
  413. </table>
  414. <table>
  415. <!--
  416. Shares of all types (user-to-user, external-via-link, etc.)
  417. -->
  418. <name>*dbprefix*share</name>
  419. <declaration>
  420. <field>
  421. <name>id</name>
  422. <autoincrement>1</autoincrement>
  423. <type>integer</type>
  424. <default>0</default>
  425. <notnull>true</notnull>
  426. <length>4</length>
  427. </field>
  428. <!-- Constant OCP\Share::SHARE_TYPE_* -->
  429. <field>
  430. <name>share_type</name>
  431. <type>integer</type>
  432. <default>0</default>
  433. <notnull>true</notnull>
  434. <length>1</length>
  435. </field>
  436. <!-- Foreign Key users::uid or NULL -->
  437. <field>
  438. <name>share_with</name>
  439. <type>text</type>
  440. <default></default>
  441. <notnull>false</notnull>
  442. <length>255</length>
  443. </field>
  444. <!-- Foreign Key users::uid -->
  445. <!-- This is the owner of the share
  446. which does not have to be the initiator of the share -->
  447. <field>
  448. <name>uid_owner</name>
  449. <type>text</type>
  450. <default></default>
  451. <notnull>true</notnull>
  452. <length>64</length>
  453. </field>
  454. <!-- Foreign Key users::uid -->
  455. <!-- This is the initiator of the share -->
  456. <field>
  457. <name>uid_initiator</name>
  458. <type>text</type>
  459. <default></default>
  460. <notnull>false</notnull>
  461. <length>64</length>
  462. </field>
  463. <!-- Foreign Key share::id or NULL -->
  464. <field>
  465. <name>parent</name>
  466. <type>integer</type>
  467. <notnull>false</notnull>
  468. <length>4</length>
  469. </field>
  470. <!-- E.g. file or folder -->
  471. <field>
  472. <name>item_type</name>
  473. <type>text</type>
  474. <default></default>
  475. <notnull>true</notnull>
  476. <length>64</length>
  477. </field>
  478. <!-- Foreign Key filecache::fileid -->
  479. <field>
  480. <name>item_source</name>
  481. <type>text</type>
  482. <default></default>
  483. <notnull>false</notnull>
  484. <length>255</length>
  485. </field>
  486. <field>
  487. <name>item_target</name>
  488. <type>text</type>
  489. <default></default>
  490. <notnull>false</notnull>
  491. <length>255</length>
  492. </field>
  493. <!-- Foreign Key filecache::fileid -->
  494. <field>
  495. <name>file_source</name>
  496. <type>integer</type>
  497. <notnull>false</notnull>
  498. <length>4</length>
  499. </field>
  500. <field>
  501. <name>file_target</name>
  502. <type>text</type>
  503. <default></default>
  504. <notnull>false</notnull>
  505. <length>512</length>
  506. </field>
  507. <!-- Permission bitfield -->
  508. <field>
  509. <name>permissions</name>
  510. <type>integer</type>
  511. <default>0</default>
  512. <notnull>true</notnull>
  513. <length>1</length>
  514. </field>
  515. <!-- Time of share creation -->
  516. <field>
  517. <name>stime</name>
  518. <type>integer</type>
  519. <default>0</default>
  520. <notnull>true</notnull>
  521. <length>8</length>
  522. </field>
  523. <!-- Whether the receiver accepted the share, if share_with is set. -->
  524. <field>
  525. <name>accepted</name>
  526. <type>integer</type>
  527. <default>0</default>
  528. <notnull>true</notnull>
  529. <length>1</length>
  530. </field>
  531. <!-- Time of share expiration -->
  532. <field>
  533. <name>expiration</name>
  534. <type>timestamp</type>
  535. <default></default>
  536. <notnull>false</notnull>
  537. </field>
  538. <field>
  539. <name>token</name>
  540. <type>text</type>
  541. <default></default>
  542. <notnull>false</notnull>
  543. <length>32</length>
  544. </field>
  545. <field>
  546. <name>mail_send</name>
  547. <type>integer</type>
  548. <default>0</default>
  549. <notnull>true</notnull>
  550. <length>1</length>
  551. </field>
  552. </declaration>
  553. </table>
  554. <table>
  555. <!--
  556. Scheduled background jobs.
  557. See OC\BackgroundJob\JobList.
  558. -->
  559. <name>*dbprefix*jobs</name>
  560. <declaration>
  561. <field>
  562. <name>id</name>
  563. <type>integer</type>
  564. <default>0</default>
  565. <notnull>true</notnull>
  566. <autoincrement>1</autoincrement>
  567. <unsigned>true</unsigned>
  568. <length>4</length>
  569. </field>
  570. <field>
  571. <name>class</name>
  572. <type>text</type>
  573. <default></default>
  574. <notnull>true</notnull>
  575. <length>255</length>
  576. </field>
  577. <field>
  578. <name>argument</name>
  579. <type>text</type>
  580. <default></default>
  581. <notnull>true</notnull>
  582. <length>4000</length>
  583. </field>
  584. <field>
  585. <!-- timestamp when the job was executed the last time -->
  586. <name>last_run</name>
  587. <type>integer</type>
  588. <default></default>
  589. <notnull>false</notnull>
  590. </field>
  591. <field>
  592. <!-- timestamp when the job was checked if it needs execution the last time -->
  593. <name>last_checked</name>
  594. <type>integer</type>
  595. <default></default>
  596. <notnull>false</notnull>
  597. </field>
  598. <field>
  599. <!-- timestamp when the job was reserved the last time, 1 day timeout -->
  600. <name>reserved_at</name>
  601. <type>integer</type>
  602. <default></default>
  603. <notnull>false</notnull>
  604. </field>
  605. </declaration>
  606. </table>
  607. <table>
  608. <!--
  609. List of usernames, their display name and login password.
  610. -->
  611. <name>*dbprefix*users</name>
  612. <declaration>
  613. <field>
  614. <name>uid</name>
  615. <type>text</type>
  616. <default></default>
  617. <notnull>true</notnull>
  618. <length>64</length>
  619. </field>
  620. <field>
  621. <name>displayname</name>
  622. <type>text</type>
  623. <default></default>
  624. <length>64</length>
  625. </field>
  626. <field>
  627. <name>password</name>
  628. <type>text</type>
  629. <default></default>
  630. <notnull>true</notnull>
  631. <length>255</length>
  632. </field>
  633. </declaration>
  634. </table>
  635. <table>
  636. <name>*dbprefix*authtoken</name>
  637. <declaration>
  638. <field>
  639. <name>id</name>
  640. <type>integer</type>
  641. <default>0</default>
  642. <notnull>true</notnull>
  643. <autoincrement>1</autoincrement>
  644. <unsigned>true</unsigned>
  645. <length>4</length>
  646. </field>
  647. <!-- Foreign Key users::uid -->
  648. <field>
  649. <name>uid</name>
  650. <type>text</type>
  651. <default></default>
  652. <notnull>true</notnull>
  653. <length>64</length>
  654. </field>
  655. <field>
  656. <name>login_name</name>
  657. <type>text</type>
  658. <default></default>
  659. <notnull>true</notnull>
  660. <length>64</length>
  661. </field>
  662. <field>
  663. <name>password</name>
  664. <type>clob</type>
  665. <default></default>
  666. <notnull>false</notnull>
  667. </field>
  668. <field>
  669. <name>name</name>
  670. <type>clob</type>
  671. <default></default>
  672. <notnull>true</notnull>
  673. </field>
  674. <field>
  675. <name>token</name>
  676. <type>text</type>
  677. <default></default>
  678. <notnull>true</notnull>
  679. <length>200</length>
  680. </field>
  681. <field>
  682. <name>type</name>
  683. <type>integer</type>
  684. <default>0</default>
  685. <notnull>true</notnull>
  686. <unsigned>true</unsigned>
  687. <length>2</length>
  688. </field>
  689. <field>
  690. <name>last_activity</name>
  691. <type>integer</type>
  692. <default>0</default>
  693. <notnull>true</notnull>
  694. <unsigned>true</unsigned>
  695. <length>4</length>
  696. </field>
  697. </declaration>
  698. </table>
  699. <table>
  700. <!--
  701. List of tags (category) + a unique tag id (id) per user (uid) and type.
  702. -->
  703. <name>*dbprefix*vcategory</name>
  704. <declaration>
  705. <field>
  706. <name>id</name>
  707. <type>integer</type>
  708. <default>0</default>
  709. <notnull>true</notnull>
  710. <autoincrement>1</autoincrement>
  711. <unsigned>true</unsigned>
  712. <length>4</length>
  713. </field>
  714. <!-- Foreign Key users::uid -->
  715. <field>
  716. <name>uid</name>
  717. <type>text</type>
  718. <default></default>
  719. <notnull>true</notnull>
  720. <length>64</length>
  721. </field>
  722. <field>
  723. <name>type</name>
  724. <type>text</type>
  725. <default></default>
  726. <notnull>true</notnull>
  727. <length>64</length>
  728. </field>
  729. <field>
  730. <name>category</name>
  731. <type>text</type>
  732. <default></default>
  733. <notnull>true</notnull>
  734. <length>255</length>
  735. </field>
  736. </declaration>
  737. </table>
  738. <table>
  739. <!--
  740. Object-Tag associations per tag type.
  741. -->
  742. <name>*dbprefix*vcategory_to_object</name>
  743. <declaration>
  744. <field>
  745. <name>objid</name>
  746. <type>integer</type>
  747. <default>0</default>
  748. <notnull>true</notnull>
  749. <unsigned>true</unsigned>
  750. <length>4</length>
  751. </field>
  752. <!-- Foreign Key vcategory::id -->
  753. <field>
  754. <name>categoryid</name>
  755. <type>integer</type>
  756. <default>0</default>
  757. <notnull>true</notnull>
  758. <unsigned>true</unsigned>
  759. <length>4</length>
  760. </field>
  761. <field>
  762. <name>type</name>
  763. <type>text</type>
  764. <default></default>
  765. <notnull>true</notnull>
  766. <length>64</length>
  767. </field>
  768. </declaration>
  769. </table>
  770. <table>
  771. <!--
  772. List of system-wide tags
  773. -->
  774. <name>*dbprefix*systemtag</name>
  775. <declaration>
  776. <field>
  777. <name>id</name>
  778. <type>integer</type>
  779. <default>0</default>
  780. <notnull>true</notnull>
  781. <autoincrement>1</autoincrement>
  782. <unsigned>true</unsigned>
  783. <length>4</length>
  784. </field>
  785. <!-- Tag name -->
  786. <field>
  787. <name>name</name>
  788. <type>text</type>
  789. <default></default>
  790. <notnull>true</notnull>
  791. <length>64</length>
  792. </field>
  793. <!-- Visibility: 0 user-not-visible, 1 user-visible -->
  794. <field>
  795. <name>visibility</name>
  796. <type>integer</type>
  797. <default>1</default>
  798. <notnull>true</notnull>
  799. <length>1</length>
  800. </field>
  801. <!-- Editable: 0 user-not-editable, 1 user-editable -->
  802. <field>
  803. <name>editable</name>
  804. <type>integer</type>
  805. <default>1</default>
  806. <notnull>true</notnull>
  807. <length>1</length>
  808. </field>
  809. </declaration>
  810. </table>
  811. <table>
  812. <!--
  813. System tag to object associations per object type.
  814. -->
  815. <name>*dbprefix*systemtag_object_mapping</name>
  816. <declaration>
  817. <!-- object id (ex: file id for files)-->
  818. <field>
  819. <name>objectid</name>
  820. <type>text</type>
  821. <default></default>
  822. <notnull>true</notnull>
  823. <length>64</length>
  824. </field>
  825. <!-- object type (ex: "files")-->
  826. <field>
  827. <name>objecttype</name>
  828. <type>text</type>
  829. <default></default>
  830. <notnull>true</notnull>
  831. <length>64</length>
  832. </field>
  833. <!-- Foreign Key systemtag::id -->
  834. <field>
  835. <name>systemtagid</name>
  836. <type>integer</type>
  837. <default>0</default>
  838. <notnull>true</notnull>
  839. <unsigned>true</unsigned>
  840. <length>4</length>
  841. </field>
  842. </declaration>
  843. </table>
  844. <table>
  845. <!--
  846. System tag to group mapping
  847. -->
  848. <name>*dbprefix*systemtag_group</name>
  849. <declaration>
  850. <!-- Foreign Key systemtag::id -->
  851. <field>
  852. <name>systemtagid</name>
  853. <type>integer</type>
  854. <default>0</default>
  855. <notnull>true</notnull>
  856. <unsigned>true</unsigned>
  857. <length>4</length>
  858. </field>
  859. <field>
  860. <name>gid</name>
  861. <type>string</type>
  862. <notnull>true</notnull>
  863. </field>
  864. </declaration>
  865. </table>
  866. <table>
  867. <!--
  868. Namespaced Key-Value Store for arbitrary data.
  869. - Keys are namespaced per userid and appid.
  870. - E.g. (admin, files, foo) -> bar
  871. -->
  872. <name>*dbprefix*privatedata</name>
  873. <declaration>
  874. <field>
  875. <name>keyid</name>
  876. <type>integer</type>
  877. <default>0</default>
  878. <notnull>true</notnull>
  879. <unsigned>true</unsigned>
  880. <length>4</length>
  881. <autoincrement>1</autoincrement>
  882. </field>
  883. <!-- Foreign Key users::uid -->
  884. <field>
  885. <name>user</name>
  886. <type>text</type>
  887. <default></default>
  888. <notnull>true</notnull>
  889. <length>64</length>
  890. </field>
  891. <field>
  892. <name>app</name>
  893. <type>text</type>
  894. <default></default>
  895. <notnull>true</notnull>
  896. <length>255</length>
  897. </field>
  898. <field>
  899. <name>key</name>
  900. <type>text</type>
  901. <default></default>
  902. <notnull>true</notnull>
  903. <length>255</length>
  904. </field>
  905. <field>
  906. <name>value</name>
  907. <type>text</type>
  908. <default></default>
  909. <notnull>true</notnull>
  910. <length>255</length>
  911. </field>
  912. </declaration>
  913. </table>
  914. <table>
  915. <!--
  916. Table for storing transactional file locking
  917. -->
  918. <name>*dbprefix*file_locks</name>
  919. <declaration>
  920. <field>
  921. <name>id</name>
  922. <type>integer</type>
  923. <default>0</default>
  924. <notnull>true</notnull>
  925. <unsigned>true</unsigned>
  926. <length>4</length>
  927. <autoincrement>1</autoincrement>
  928. </field>
  929. <field>
  930. <name>lock</name>
  931. <type>integer</type>
  932. <default>0</default>
  933. <notnull>true</notnull>
  934. <length>4</length>
  935. </field>
  936. <field>
  937. <name>key</name>
  938. <type>text</type>
  939. <notnull>true</notnull>
  940. <length>64</length>
  941. </field>
  942. <field>
  943. <name>ttl</name>
  944. <type>integer</type>
  945. <default>-1</default>
  946. <notnull>true</notnull>
  947. <length>4</length>
  948. </field>
  949. </declaration>
  950. </table>
  951. <table>
  952. <!--
  953. default place to store comment data
  954. -->
  955. <name>*dbprefix*comments</name>
  956. <declaration>
  957. <field>
  958. <name>id</name>
  959. <type>integer</type>
  960. <default>0</default>
  961. <notnull>true</notnull>
  962. <unsigned>true</unsigned>
  963. <length>4</length>
  964. <autoincrement>1</autoincrement>
  965. </field>
  966. <field>
  967. <name>parent_id</name>
  968. <type>integer</type>
  969. <default>0</default>
  970. <notnull>true</notnull>
  971. <unsigned>true</unsigned>
  972. <length>4</length>
  973. </field>
  974. <field>
  975. <name>topmost_parent_id</name>
  976. <type>integer</type>
  977. <default>0</default>
  978. <notnull>true</notnull>
  979. <unsigned>true</unsigned>
  980. <length>4</length>
  981. </field>
  982. <field>
  983. <name>children_count</name>
  984. <type>integer</type>
  985. <default>0</default>
  986. <notnull>true</notnull>
  987. <unsigned>true</unsigned>
  988. <length>4</length>
  989. </field>
  990. <field>
  991. <name>actor_type</name>
  992. <type>text</type>
  993. <default></default>
  994. <notnull>true</notnull>
  995. <length>64</length>
  996. </field>
  997. <field>
  998. <name>actor_id</name>
  999. <type>text</type>
  1000. <default></default>
  1001. <notnull>true</notnull>
  1002. <length>64</length>
  1003. </field>
  1004. <field>
  1005. <name>message</name>
  1006. <type>clob</type>
  1007. <default></default>
  1008. <notnull>false</notnull>
  1009. </field>
  1010. <field>
  1011. <name>verb</name>
  1012. <type>text</type>
  1013. <default></default>
  1014. <notnull>false</notnull>
  1015. <length>64</length>
  1016. </field>
  1017. <field>
  1018. <name>creation_timestamp</name>
  1019. <type>timestamp</type>
  1020. <default></default>
  1021. <notnull>false</notnull>
  1022. </field>
  1023. <field>
  1024. <name>latest_child_timestamp</name>
  1025. <type>timestamp</type>
  1026. <default></default>
  1027. <notnull>false</notnull>
  1028. </field>
  1029. <field>
  1030. <name>object_type</name>
  1031. <type>text</type>
  1032. <default></default>
  1033. <notnull>true</notnull>
  1034. <length>64</length>
  1035. </field>
  1036. <field>
  1037. <name>object_id</name>
  1038. <type>text</type>
  1039. <default></default>
  1040. <notnull>true</notnull>
  1041. <length>64</length>
  1042. </field>
  1043. </declaration>
  1044. </table>
  1045. <table>
  1046. <!--
  1047. default place to store per user and object read markers
  1048. -->
  1049. <name>*dbprefix*comments_read_markers</name>
  1050. <declaration>
  1051. <field>
  1052. <name>user_id</name>
  1053. <type>text</type>
  1054. <default></default>
  1055. <notnull>true</notnull>
  1056. <length>64</length>
  1057. </field>
  1058. <field>
  1059. <name>marker_datetime</name>
  1060. <type>timestamp</type>
  1061. <default></default>
  1062. <notnull>false</notnull>
  1063. </field>
  1064. <field>
  1065. <name>object_type</name>
  1066. <type>text</type>
  1067. <default></default>
  1068. <notnull>true</notnull>
  1069. <length>64</length>
  1070. </field>
  1071. <field>
  1072. <name>object_id</name>
  1073. <type>text</type>
  1074. <default></default>
  1075. <notnull>true</notnull>
  1076. <length>64</length>
  1077. </field>
  1078. </declaration>
  1079. </table>
  1080. <table>
  1081. <!--
  1082. Encrypted credentials storage
  1083. -->
  1084. <name>*dbprefix*credentials</name>
  1085. <declaration>
  1086. <field>
  1087. <name>user</name>
  1088. <type>text</type>
  1089. <default></default>
  1090. <notnull>false</notnull>
  1091. <length>64</length>
  1092. </field>
  1093. <field>
  1094. <name>identifier</name>
  1095. <type>text</type>
  1096. <notnull>true</notnull>
  1097. <length>64</length>
  1098. </field>
  1099. <field>
  1100. <name>credentials</name>
  1101. <type>clob</type>
  1102. <notnull>false</notnull>
  1103. </field>
  1104. </declaration>
  1105. </table>
  1106. </database>