db_structure.xml 23 KB

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