db_structure.xml 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498
  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>integer</type>
  91. <default>1</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. <!--
  110. Bidirectional Map for Mimetypes and Mimetype Id
  111. - Assigns each mimetype (and supertype) a unique mimetype id integer.
  112. - E.g. application <-> 5
  113. - E.g. application/pdf <-> 6
  114. -->
  115. <name>*dbprefix*mimetypes</name>
  116. <declaration>
  117. <field>
  118. <name>id</name>
  119. <type>integer</type>
  120. <default>0</default>
  121. <notnull>true</notnull>
  122. <autoincrement>1</autoincrement>
  123. <length>4</length>
  124. </field>
  125. <field>
  126. <name>mimetype</name>
  127. <type>text</type>
  128. <default></default>
  129. <notnull>true</notnull>
  130. <length>255</length>
  131. </field>
  132. <index>
  133. <name>mimetype_id_index</name>
  134. <unique>true</unique>
  135. <field>
  136. <name>mimetype</name>
  137. <sorting>ascending</sorting>
  138. </field>
  139. </index>
  140. </declaration>
  141. </table>
  142. <table>
  143. <!--
  144. Main file table containing one row for each directory and file.
  145. - Assigns a unique integer fileid to each file (and directory)
  146. - Assigns an etag to each file (and directory)
  147. - Caches various file/dir properties such as:
  148. - path (filename, e.g. files/combinatoricslib-2.0_doc.zip)
  149. - path_hash = md5(path)
  150. - name (basename, e.g. combinatoricslib-2.0_doc.zip)
  151. - size (for directories this is the sum of all contained file sizes)
  152. -->
  153. <name>*dbprefix*filecache</name>
  154. <declaration>
  155. <field>
  156. <name>fileid</name>
  157. <type>integer</type>
  158. <default>0</default>
  159. <notnull>true</notnull>
  160. <autoincrement>1</autoincrement>
  161. <length>4</length>
  162. </field>
  163. <!-- Foreign Key storages::numeric_id -->
  164. <field>
  165. <name>storage</name>
  166. <type>integer</type>
  167. <default></default>
  168. <notnull>true</notnull>
  169. <length>4</length>
  170. </field>
  171. <field>
  172. <name>path</name>
  173. <type>text</type>
  174. <default></default>
  175. <notnull>false</notnull>
  176. <length>4000</length>
  177. </field>
  178. <field>
  179. <name>path_hash</name>
  180. <type>text</type>
  181. <default></default>
  182. <notnull>true</notnull>
  183. <length>32</length>
  184. </field>
  185. <!-- Foreign Key filecache::fileid -->
  186. <field>
  187. <name>parent</name>
  188. <type>integer</type>
  189. <default></default>
  190. <notnull>true</notnull>
  191. <length>4</length>
  192. </field>
  193. <field>
  194. <name>name</name>
  195. <type>text</type>
  196. <default></default>
  197. <notnull>false</notnull>
  198. <length>250</length>
  199. </field>
  200. <!-- Foreign Key mimetypes::id -->
  201. <field>
  202. <name>mimetype</name>
  203. <type>integer</type>
  204. <default></default>
  205. <notnull>true</notnull>
  206. <length>4</length>
  207. </field>
  208. <!-- Foreign Key mimetypes::id -->
  209. <field>
  210. <name>mimepart</name>
  211. <type>integer</type>
  212. <default></default>
  213. <notnull>true</notnull>
  214. <length>4</length>
  215. </field>
  216. <field>
  217. <name>size</name>
  218. <type>integer</type>
  219. <default></default>
  220. <notnull>true</notnull>
  221. <length>8</length>
  222. </field>
  223. <field>
  224. <name>mtime</name>
  225. <type>integer</type>
  226. <default></default>
  227. <notnull>true</notnull>
  228. <length>4</length>
  229. </field>
  230. <field>
  231. <name>storage_mtime</name>
  232. <type>integer</type>
  233. <default></default>
  234. <notnull>true</notnull>
  235. <length>4</length>
  236. </field>
  237. <field>
  238. <name>encrypted</name>
  239. <type>integer</type>
  240. <default>0</default>
  241. <notnull>true</notnull>
  242. <length>4</length>
  243. </field>
  244. <field>
  245. <name>unencrypted_size</name>
  246. <type>integer</type>
  247. <default>0</default>
  248. <notnull>true</notnull>
  249. <length>8</length>
  250. </field>
  251. <field>
  252. <name>etag</name>
  253. <type>text</type>
  254. <default></default>
  255. <notnull>false</notnull>
  256. <length>40</length>
  257. </field>
  258. <field>
  259. <name>permissions</name>
  260. <type>integer</type>
  261. <default>0</default>
  262. <notnull>false</notnull>
  263. <length>4</length>
  264. </field>
  265. <index>
  266. <name>fs_storage_path_hash</name>
  267. <unique>true</unique>
  268. <field>
  269. <name>storage</name>
  270. <sorting>ascending</sorting>
  271. </field>
  272. <field>
  273. <name>path_hash</name>
  274. <sorting>ascending</sorting>
  275. </field>
  276. </index>
  277. <index>
  278. <name>fs_parent_name_hash</name>
  279. <field>
  280. <name>parent</name>
  281. <sorting>ascending</sorting>
  282. </field>
  283. <field>
  284. <name>name</name>
  285. <sorting>ascending</sorting>
  286. </field>
  287. </index>
  288. <index>
  289. <name>fs_storage_mimetype</name>
  290. <field>
  291. <name>storage</name>
  292. <sorting>ascending</sorting>
  293. </field>
  294. <field>
  295. <name>mimetype</name>
  296. <sorting>ascending</sorting>
  297. </field>
  298. </index>
  299. <index>
  300. <name>fs_storage_mimepart</name>
  301. <field>
  302. <name>storage</name>
  303. <sorting>ascending</sorting>
  304. </field>
  305. <field>
  306. <name>mimepart</name>
  307. <sorting>ascending</sorting>
  308. </field>
  309. </index>
  310. <index>
  311. <name>fs_storage_size</name>
  312. <field>
  313. <name>storage</name>
  314. <sorting>ascending</sorting>
  315. </field>
  316. <field>
  317. <name>size</name>
  318. <sorting>ascending</sorting>
  319. </field>
  320. <field>
  321. <name>fileid</name>
  322. </field>
  323. </index>
  324. </declaration>
  325. </table>
  326. <table>
  327. <!--
  328. Stores which groups have which users as members in an n:m relationship.
  329. - Maps group id (gid) to a set of users (uid)
  330. - Maps user id (uid) to a set of groups (gid) (but without index)
  331. -->
  332. <name>*dbprefix*group_user</name>
  333. <declaration>
  334. <!-- Foreign Key groups::gid -->
  335. <field>
  336. <name>gid</name>
  337. <type>text</type>
  338. <default></default>
  339. <notnull>true</notnull>
  340. <length>64</length>
  341. </field>
  342. <!-- Foreign Key users::uid -->
  343. <field>
  344. <name>uid</name>
  345. <type>text</type>
  346. <default></default>
  347. <notnull>true</notnull>
  348. <length>64</length>
  349. </field>
  350. <index>
  351. <name>gu_gid_uid_index</name>
  352. <primary>true</primary>
  353. <unique>true</unique>
  354. <field>
  355. <name>gid</name>
  356. <sorting>ascending</sorting>
  357. </field>
  358. <field>
  359. <name>uid</name>
  360. <sorting>ascending</sorting>
  361. </field>
  362. </index>
  363. <index>
  364. <name>gu_uid_index</name>
  365. <field>
  366. <name>uid</name>
  367. <sorting>ascending</sorting>
  368. </field>
  369. </index>
  370. </declaration>
  371. </table>
  372. <table>
  373. <!--
  374. Stores which groups have which users as admins in an n:m relationship.
  375. - Maps group id (gid) to a set of users (uid)
  376. - Maps user id (uid) to a set of groups (gid)
  377. NOTE: This could (very likely) be reduced to a single bit in group_user
  378. instead of repeating varchars gid and uid here
  379. -->
  380. <name>*dbprefix*group_admin</name>
  381. <declaration>
  382. <!-- Foreign Key groups::gid -->
  383. <field>
  384. <name>gid</name>
  385. <type>text</type>
  386. <default></default>
  387. <notnull>true</notnull>
  388. <length>64</length>
  389. </field>
  390. <!-- Foreign Key users::uid -->
  391. <field>
  392. <name>uid</name>
  393. <type>text</type>
  394. <default></default>
  395. <notnull>true</notnull>
  396. <length>64</length>
  397. </field>
  398. <index>
  399. <name>group_admin_uid</name>
  400. <field>
  401. <name>uid</name>
  402. <sorting>ascending</sorting>
  403. </field>
  404. </index>
  405. <index>
  406. <name>ga_gid_uid_index</name>
  407. <primary>true</primary>
  408. <unique>true</unique>
  409. <field>
  410. <name>gid</name>
  411. <sorting>ascending</sorting>
  412. </field>
  413. <field>
  414. <name>uid</name>
  415. <sorting>ascending</sorting>
  416. </field>
  417. </index>
  418. </declaration>
  419. </table>
  420. <table>
  421. <!--
  422. A simple list of groups.
  423. -->
  424. <name>*dbprefix*groups</name>
  425. <declaration>
  426. <field>
  427. <name>gid</name>
  428. <type>text</type>
  429. <default></default>
  430. <notnull>true</notnull>
  431. <length>64</length>
  432. </field>
  433. <index>
  434. <name>groups_pKey</name>
  435. <primary>true</primary>
  436. <field>
  437. <name>gid</name>
  438. <sorting>ascending</sorting>
  439. </field>
  440. </index>
  441. </declaration>
  442. </table>
  443. <table>
  444. <!--
  445. Namespaced Key-Value Store for User Preferences
  446. - Keys are namespaced per userid and appid.
  447. - E.g. (admin, files, cache_version) -> 5
  448. -->
  449. <name>*dbprefix*preferences</name>
  450. <declaration>
  451. <!-- Foreign Key users::uid -->
  452. <field>
  453. <name>userid</name>
  454. <type>text</type>
  455. <default></default>
  456. <notnull>true</notnull>
  457. <length>64</length>
  458. </field>
  459. <field>
  460. <name>appid</name>
  461. <type>text</type>
  462. <default></default>
  463. <notnull>true</notnull>
  464. <length>32</length>
  465. </field>
  466. <field>
  467. <name>configkey</name>
  468. <type>text</type>
  469. <default></default>
  470. <notnull>true</notnull>
  471. <length>64</length>
  472. </field>
  473. <field>
  474. <name>configvalue</name>
  475. <type>clob</type>
  476. <notnull>false</notnull>
  477. </field>
  478. <index>
  479. <name>pref_userid_appid_key_index</name>
  480. <primary>true</primary>
  481. <unique>true</unique>
  482. <field>
  483. <name>userid</name>
  484. <sorting>ascending</sorting>
  485. </field>
  486. <field>
  487. <name>appid</name>
  488. <sorting>ascending</sorting>
  489. </field>
  490. <field>
  491. <name>configkey</name>
  492. <sorting>ascending</sorting>
  493. </field>
  494. </index>
  495. </declaration>
  496. </table>
  497. <table>
  498. <!--
  499. WebDAV properties.
  500. -->
  501. <name>*dbprefix*properties</name>
  502. <declaration>
  503. <field>
  504. <name>id</name>
  505. <autoincrement>1</autoincrement>
  506. <type>integer</type>
  507. <default>0</default>
  508. <notnull>true</notnull>
  509. <length>4</length>
  510. </field>
  511. <!-- Foreign Key users::uid -->
  512. <field>
  513. <name>userid</name>
  514. <type>text</type>
  515. <default></default>
  516. <notnull>true</notnull>
  517. <length>64</length>
  518. </field>
  519. <field>
  520. <name>propertypath</name>
  521. <type>text</type>
  522. <default></default>
  523. <notnull>true</notnull>
  524. <length>255</length>
  525. </field>
  526. <field>
  527. <name>propertyname</name>
  528. <type>text</type>
  529. <default></default>
  530. <notnull>true</notnull>
  531. <length>255</length>
  532. </field>
  533. <field>
  534. <name>propertyvalue</name>
  535. <type>text</type>
  536. <notnull>true</notnull>
  537. <length>255</length>
  538. </field>
  539. <index>
  540. <name>property_index</name>
  541. <field>
  542. <name>userid</name>
  543. <sorting>ascending</sorting>
  544. </field>
  545. </index>
  546. </declaration>
  547. </table>
  548. <table>
  549. <!--
  550. Shares of all types (user-to-user, external-via-link, etc.)
  551. -->
  552. <name>*dbprefix*share</name>
  553. <declaration>
  554. <field>
  555. <name>id</name>
  556. <autoincrement>1</autoincrement>
  557. <type>integer</type>
  558. <default>0</default>
  559. <notnull>true</notnull>
  560. <length>4</length>
  561. </field>
  562. <!-- Constant OCP\Share::SHARE_TYPE_* -->
  563. <field>
  564. <name>share_type</name>
  565. <type>integer</type>
  566. <default>0</default>
  567. <notnull>true</notnull>
  568. <length>1</length>
  569. </field>
  570. <!-- Foreign Key users::uid or NULL -->
  571. <field>
  572. <name>share_with</name>
  573. <type>text</type>
  574. <default></default>
  575. <notnull>false</notnull>
  576. <length>255</length>
  577. </field>
  578. <!-- Foreign Key users::uid -->
  579. <!-- This is the owner of the share
  580. which does not have to be the initiator of the share -->
  581. <field>
  582. <name>uid_owner</name>
  583. <type>text</type>
  584. <default></default>
  585. <notnull>true</notnull>
  586. <length>64</length>
  587. </field>
  588. <!-- Foreign Key users::uid -->
  589. <!-- This is the initiator of the share -->
  590. <field>
  591. <name>uid_initiator</name>
  592. <type>text</type>
  593. <default></default>
  594. <notnull>false</notnull>
  595. <length>64</length>
  596. </field>
  597. <!-- Foreign Key share::id or NULL -->
  598. <field>
  599. <name>parent</name>
  600. <type>integer</type>
  601. <notnull>false</notnull>
  602. <length>4</length>
  603. </field>
  604. <!-- E.g. file or folder -->
  605. <field>
  606. <name>item_type</name>
  607. <type>text</type>
  608. <default></default>
  609. <notnull>true</notnull>
  610. <length>64</length>
  611. </field>
  612. <!-- Foreign Key filecache::fileid -->
  613. <field>
  614. <name>item_source</name>
  615. <type>text</type>
  616. <default></default>
  617. <notnull>false</notnull>
  618. <length>255</length>
  619. </field>
  620. <field>
  621. <name>item_target</name>
  622. <type>text</type>
  623. <default></default>
  624. <notnull>false</notnull>
  625. <length>255</length>
  626. </field>
  627. <!-- Foreign Key filecache::fileid -->
  628. <field>
  629. <name>file_source</name>
  630. <type>integer</type>
  631. <notnull>false</notnull>
  632. <length>4</length>
  633. </field>
  634. <field>
  635. <name>file_target</name>
  636. <type>text</type>
  637. <default></default>
  638. <notnull>false</notnull>
  639. <length>512</length>
  640. </field>
  641. <!-- Permission bitfield -->
  642. <field>
  643. <name>permissions</name>
  644. <type>integer</type>
  645. <default>0</default>
  646. <notnull>true</notnull>
  647. <length>1</length>
  648. </field>
  649. <!-- Time of share creation -->
  650. <field>
  651. <name>stime</name>
  652. <type>integer</type>
  653. <default>0</default>
  654. <notnull>true</notnull>
  655. <length>8</length>
  656. </field>
  657. <!-- Whether the receiver accepted the share, if share_with is set. -->
  658. <field>
  659. <name>accepted</name>
  660. <type>integer</type>
  661. <default>0</default>
  662. <notnull>true</notnull>
  663. <length>1</length>
  664. </field>
  665. <!-- Time of share expiration -->
  666. <field>
  667. <name>expiration</name>
  668. <type>timestamp</type>
  669. <default></default>
  670. <notnull>false</notnull>
  671. </field>
  672. <field>
  673. <name>token</name>
  674. <type>text</type>
  675. <default></default>
  676. <notnull>false</notnull>
  677. <length>32</length>
  678. </field>
  679. <field>
  680. <name>mail_send</name>
  681. <type>integer</type>
  682. <default>0</default>
  683. <notnull>true</notnull>
  684. <length>1</length>
  685. </field>
  686. <index>
  687. <name>item_share_type_index</name>
  688. <field>
  689. <name>item_type</name>
  690. <sorting>ascending</sorting>
  691. </field>
  692. <field>
  693. <name>share_type</name>
  694. <sorting>ascending</sorting>
  695. </field>
  696. </index>
  697. <index>
  698. <name>file_source_index</name>
  699. <field>
  700. <name>file_source</name>
  701. <sorting>ascending</sorting>
  702. </field>
  703. </index>
  704. <index>
  705. <name>token_index</name>
  706. <field>
  707. <name>token</name>
  708. <sorting>ascending</sorting>
  709. </field>
  710. </index>
  711. </declaration>
  712. </table>
  713. <table>
  714. <!--
  715. Scheduled background jobs.
  716. See OC\BackgroundJob\JobList.
  717. -->
  718. <name>*dbprefix*jobs</name>
  719. <declaration>
  720. <field>
  721. <name>id</name>
  722. <type>integer</type>
  723. <default>0</default>
  724. <notnull>true</notnull>
  725. <autoincrement>1</autoincrement>
  726. <unsigned>true</unsigned>
  727. <length>4</length>
  728. </field>
  729. <field>
  730. <name>class</name>
  731. <type>text</type>
  732. <default></default>
  733. <notnull>true</notnull>
  734. <length>255</length>
  735. </field>
  736. <field>
  737. <name>argument</name>
  738. <type>text</type>
  739. <default></default>
  740. <notnull>true</notnull>
  741. <length>4000</length>
  742. </field>
  743. <field>
  744. <name>last_run</name>
  745. <type>integer</type>
  746. <default></default>
  747. <notnull>false</notnull>
  748. </field>
  749. <index>
  750. <name>job_class_index</name>
  751. <field>
  752. <name>class</name>
  753. <sorting>ascending</sorting>
  754. </field>
  755. </index>
  756. </declaration>
  757. </table>
  758. <table>
  759. <!--
  760. List of usernames, their display name and login password.
  761. -->
  762. <name>*dbprefix*users</name>
  763. <declaration>
  764. <field>
  765. <name>uid</name>
  766. <type>text</type>
  767. <default></default>
  768. <notnull>true</notnull>
  769. <length>64</length>
  770. </field>
  771. <field>
  772. <name>displayname</name>
  773. <type>text</type>
  774. <default></default>
  775. <length>64</length>
  776. </field>
  777. <field>
  778. <name>password</name>
  779. <type>text</type>
  780. <default></default>
  781. <notnull>true</notnull>
  782. <length>255</length>
  783. </field>
  784. <index>
  785. <name>users_pKey</name>
  786. <primary>true</primary>
  787. <field>
  788. <name>uid</name>
  789. <sorting>ascending</sorting>
  790. </field>
  791. </index>
  792. </declaration>
  793. </table>
  794. <table>
  795. <!--
  796. List of tags (category) + a unique tag id (id) per user (uid) and type.
  797. -->
  798. <name>*dbprefix*vcategory</name>
  799. <declaration>
  800. <field>
  801. <name>id</name>
  802. <type>integer</type>
  803. <default>0</default>
  804. <notnull>true</notnull>
  805. <autoincrement>1</autoincrement>
  806. <unsigned>true</unsigned>
  807. <length>4</length>
  808. </field>
  809. <!-- Foreign Key users::uid -->
  810. <field>
  811. <name>uid</name>
  812. <type>text</type>
  813. <default></default>
  814. <notnull>true</notnull>
  815. <length>64</length>
  816. </field>
  817. <field>
  818. <name>type</name>
  819. <type>text</type>
  820. <default></default>
  821. <notnull>true</notnull>
  822. <length>64</length>
  823. </field>
  824. <field>
  825. <name>category</name>
  826. <type>text</type>
  827. <default></default>
  828. <notnull>true</notnull>
  829. <length>255</length>
  830. </field>
  831. <index>
  832. <name>uid_index</name>
  833. <field>
  834. <name>uid</name>
  835. <sorting>ascending</sorting>
  836. </field>
  837. </index>
  838. <index>
  839. <name>type_index</name>
  840. <field>
  841. <name>type</name>
  842. <sorting>ascending</sorting>
  843. </field>
  844. </index>
  845. <index>
  846. <name>category_index</name>
  847. <field>
  848. <name>category</name>
  849. <sorting>ascending</sorting>
  850. </field>
  851. </index>
  852. </declaration>
  853. </table>
  854. <table>
  855. <!--
  856. Object-Tag associations per tag type.
  857. -->
  858. <name>*dbprefix*vcategory_to_object</name>
  859. <declaration>
  860. <field>
  861. <name>objid</name>
  862. <type>integer</type>
  863. <default>0</default>
  864. <notnull>true</notnull>
  865. <unsigned>true</unsigned>
  866. <length>4</length>
  867. </field>
  868. <!-- Foreign Key vcategory::id -->
  869. <field>
  870. <name>categoryid</name>
  871. <type>integer</type>
  872. <default>0</default>
  873. <notnull>true</notnull>
  874. <unsigned>true</unsigned>
  875. <length>4</length>
  876. </field>
  877. <field>
  878. <name>type</name>
  879. <type>text</type>
  880. <default></default>
  881. <notnull>true</notnull>
  882. <length>64</length>
  883. </field>
  884. <index>
  885. <primary>true</primary>
  886. <unique>true</unique>
  887. <name>category_object_index</name>
  888. <field>
  889. <name>categoryid</name>
  890. <sorting>ascending</sorting>
  891. </field>
  892. <field>
  893. <name>objid</name>
  894. <sorting>ascending</sorting>
  895. </field>
  896. <field>
  897. <name>type</name>
  898. <sorting>ascending</sorting>
  899. </field>
  900. </index>
  901. <index>
  902. <name>vcategory_objectd_index</name>
  903. <field>
  904. <name>objid</name>
  905. <sorting>ascending</sorting>
  906. </field>
  907. <field>
  908. <name>type</name>
  909. <sorting>ascending</sorting>
  910. </field>
  911. </index>
  912. </declaration>
  913. </table>
  914. <table>
  915. <!--
  916. List of system-wide tags
  917. -->
  918. <name>*dbprefix*systemtag</name>
  919. <declaration>
  920. <field>
  921. <name>id</name>
  922. <type>integer</type>
  923. <default>0</default>
  924. <notnull>true</notnull>
  925. <autoincrement>1</autoincrement>
  926. <unsigned>true</unsigned>
  927. <length>4</length>
  928. </field>
  929. <!-- Tag name -->
  930. <field>
  931. <name>name</name>
  932. <type>text</type>
  933. <default></default>
  934. <notnull>true</notnull>
  935. <length>64</length>
  936. </field>
  937. <!-- Visibility: 0 user-not-visible, 1 user-visible -->
  938. <field>
  939. <name>visibility</name>
  940. <type>integer</type>
  941. <default>1</default>
  942. <notnull>true</notnull>
  943. <length>1</length>
  944. </field>
  945. <!-- Editable: 0 user-not-editable, 1 user-editable -->
  946. <field>
  947. <name>editable</name>
  948. <type>integer</type>
  949. <default>1</default>
  950. <notnull>true</notnull>
  951. <length>1</length>
  952. </field>
  953. <index>
  954. <name>tag_ident</name>
  955. <unique>true</unique>
  956. <field>
  957. <name>name</name>
  958. <sorting>ascending</sorting>
  959. </field>
  960. <field>
  961. <name>visibility</name>
  962. <sorting>ascending</sorting>
  963. </field>
  964. <field>
  965. <name>editable</name>
  966. <sorting>ascending</sorting>
  967. </field>
  968. </index>
  969. </declaration>
  970. </table>
  971. <table>
  972. <!--
  973. System tag to object associations per object type.
  974. -->
  975. <name>*dbprefix*systemtag_object_mapping</name>
  976. <declaration>
  977. <!-- object id (ex: file id for files)-->
  978. <field>
  979. <name>objectid</name>
  980. <type>integer</type>
  981. <default>0</default>
  982. <notnull>true</notnull>
  983. <unsigned>true</unsigned>
  984. <length>4</length>
  985. </field>
  986. <!-- object type (ex: "files")-->
  987. <field>
  988. <name>objecttype</name>
  989. <type>text</type>
  990. <default></default>
  991. <notnull>true</notnull>
  992. <length>64</length>
  993. </field>
  994. <!-- Foreign Key systemtag::id -->
  995. <field>
  996. <name>systemtagid</name>
  997. <type>integer</type>
  998. <default>0</default>
  999. <notnull>true</notnull>
  1000. <unsigned>true</unsigned>
  1001. <length>4</length>
  1002. </field>
  1003. <index>
  1004. <unique>true</unique>
  1005. <name>mapping</name>
  1006. <field>
  1007. <name>objecttype</name>
  1008. <sorting>ascending</sorting>
  1009. </field>
  1010. <field>
  1011. <name>objectid</name>
  1012. <sorting>ascending</sorting>
  1013. </field>
  1014. <field>
  1015. <name>systemtagid</name>
  1016. <sorting>ascending</sorting>
  1017. </field>
  1018. </index>
  1019. </declaration>
  1020. </table>
  1021. <table>
  1022. <!--
  1023. Namespaced Key-Value Store for arbitrary data.
  1024. - Keys are namespaced per userid and appid.
  1025. - E.g. (admin, files, foo) -> bar
  1026. -->
  1027. <name>*dbprefix*privatedata</name>
  1028. <declaration>
  1029. <field>
  1030. <name>keyid</name>
  1031. <type>integer</type>
  1032. <default>0</default>
  1033. <notnull>true</notnull>
  1034. <unsigned>true</unsigned>
  1035. <length>4</length>
  1036. <autoincrement>1</autoincrement>
  1037. </field>
  1038. <!-- Foreign Key users::uid -->
  1039. <field>
  1040. <name>user</name>
  1041. <type>text</type>
  1042. <default></default>
  1043. <notnull>true</notnull>
  1044. <length>64</length>
  1045. </field>
  1046. <field>
  1047. <name>app</name>
  1048. <type>text</type>
  1049. <default></default>
  1050. <notnull>true</notnull>
  1051. <length>255</length>
  1052. </field>
  1053. <field>
  1054. <name>key</name>
  1055. <type>text</type>
  1056. <default></default>
  1057. <notnull>true</notnull>
  1058. <length>255</length>
  1059. </field>
  1060. <field>
  1061. <name>value</name>
  1062. <type>text</type>
  1063. <default></default>
  1064. <notnull>true</notnull>
  1065. <length>255</length>
  1066. </field>
  1067. <index>
  1068. <primary>true</primary>
  1069. <unique>true</unique>
  1070. <name>keyid_index</name>
  1071. <field>
  1072. <name>keyid</name>
  1073. <sorting>ascending</sorting>
  1074. </field>
  1075. </index>
  1076. </declaration>
  1077. </table>
  1078. <table>
  1079. <!--
  1080. Table for storing transactional file locking
  1081. -->
  1082. <name>*dbprefix*file_locks</name>
  1083. <declaration>
  1084. <field>
  1085. <name>id</name>
  1086. <type>integer</type>
  1087. <default>0</default>
  1088. <notnull>true</notnull>
  1089. <unsigned>true</unsigned>
  1090. <length>4</length>
  1091. <autoincrement>1</autoincrement>
  1092. </field>
  1093. <field>
  1094. <name>lock</name>
  1095. <type>integer</type>
  1096. <default>0</default>
  1097. <notnull>true</notnull>
  1098. <length>4</length>
  1099. </field>
  1100. <field>
  1101. <name>key</name>
  1102. <type>text</type>
  1103. <notnull>true</notnull>
  1104. <length>64</length>
  1105. </field>
  1106. <field>
  1107. <name>ttl</name>
  1108. <type>integer</type>
  1109. <default>-1</default>
  1110. <notnull>true</notnull>
  1111. <length>4</length>
  1112. </field>
  1113. <index>
  1114. <primary>true</primary>
  1115. <unique>true</unique>
  1116. <name>lock_id_index</name>
  1117. <field>
  1118. <name>id</name>
  1119. <sorting>ascending</sorting>
  1120. </field>
  1121. </index>
  1122. <index>
  1123. <unique>true</unique>
  1124. <name>lock_key_index</name>
  1125. <field>
  1126. <name>key</name>
  1127. <sorting>ascending</sorting>
  1128. </field>
  1129. </index>
  1130. <index>
  1131. <name>lock_ttl_index</name>
  1132. <field>
  1133. <name>ttl</name>
  1134. <sorting>ascending</sorting>
  1135. </field>
  1136. </index>
  1137. </declaration>
  1138. </table>
  1139. <table>
  1140. <!--
  1141. default place to store comment data
  1142. -->
  1143. <name>*dbprefix*comments</name>
  1144. <declaration>
  1145. <field>
  1146. <name>id</name>
  1147. <type>integer</type>
  1148. <default>0</default>
  1149. <notnull>true</notnull>
  1150. <unsigned>true</unsigned>
  1151. <length>4</length>
  1152. <autoincrement>1</autoincrement>
  1153. </field>
  1154. <field>
  1155. <name>parent_id</name>
  1156. <type>integer</type>
  1157. <default>0</default>
  1158. <notnull>true</notnull>
  1159. <unsigned>true</unsigned>
  1160. <length>4</length>
  1161. </field>
  1162. <field>
  1163. <name>topmost_parent_id</name>
  1164. <type>integer</type>
  1165. <default>0</default>
  1166. <notnull>true</notnull>
  1167. <unsigned>true</unsigned>
  1168. <length>4</length>
  1169. </field>
  1170. <field>
  1171. <name>children_count</name>
  1172. <type>integer</type>
  1173. <default>0</default>
  1174. <notnull>true</notnull>
  1175. <unsigned>true</unsigned>
  1176. <length>4</length>
  1177. </field>
  1178. <field>
  1179. <name>actor_type</name>
  1180. <type>text</type>
  1181. <default></default>
  1182. <notnull>true</notnull>
  1183. <length>64</length>
  1184. </field>
  1185. <field>
  1186. <name>actor_id</name>
  1187. <type>text</type>
  1188. <default></default>
  1189. <notnull>true</notnull>
  1190. <length>64</length>
  1191. </field>
  1192. <field>
  1193. <name>message</name>
  1194. <type>clob</type>
  1195. <default></default>
  1196. <notnull>false</notnull>
  1197. </field>
  1198. <field>
  1199. <name>verb</name>
  1200. <type>text</type>
  1201. <default></default>
  1202. <notnull>false</notnull>
  1203. <length>64</length>
  1204. </field>
  1205. <field>
  1206. <name>creation_timestamp</name>
  1207. <type>timestamp</type>
  1208. <default></default>
  1209. <notnull>false</notnull>
  1210. </field>
  1211. <field>
  1212. <name>latest_child_timestamp</name>
  1213. <type>timestamp</type>
  1214. <default></default>
  1215. <notnull>false</notnull>
  1216. </field>
  1217. <field>
  1218. <name>object_type</name>
  1219. <type>text</type>
  1220. <default></default>
  1221. <notnull>true</notnull>
  1222. <length>64</length>
  1223. </field>
  1224. <field>
  1225. <name>object_id</name>
  1226. <type>text</type>
  1227. <default></default>
  1228. <notnull>true</notnull>
  1229. <length>64</length>
  1230. </field>
  1231. <!--
  1232. TODO: finalize indexes when all queries are done
  1233. <index>
  1234. <name>comments_parent_id_index</name>
  1235. <unique>false</unique>
  1236. <field>
  1237. <name>parent_id</name>
  1238. <sorting>descending</sorting>
  1239. </field>
  1240. </index>
  1241. <index>
  1242. <name>comments_actor_index</name>
  1243. <unique>false</unique>
  1244. <field>
  1245. <name>actor_type</name>
  1246. <sorting>ascending</sorting>
  1247. </field>
  1248. <field>
  1249. <name>actor_id</name>
  1250. <sorting>ascending</sorting>
  1251. </field>
  1252. </index>
  1253. <index>
  1254. <name>comments_object_index</name>
  1255. <unique>false</unique>
  1256. <field>
  1257. <name>object_type</name>
  1258. <sorting>ascending</sorting>
  1259. </field>
  1260. <field>
  1261. <name>object_id</name>
  1262. <sorting>ascending</sorting>
  1263. </field>
  1264. <field>
  1265. <name>creation_timestamp</name>
  1266. <sorting>descending</sorting>
  1267. </field>
  1268. </index>
  1269. -->
  1270. </declaration>
  1271. </table>
  1272. </database>