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 initiator of the share -->
  580. <field>
  581. <name>uid_owner</name>
  582. <type>text</type>
  583. <default></default>
  584. <notnull>true</notnull>
  585. <length>64</length>
  586. </field>
  587. <!-- Foreign Key users::uid -->
  588. <!-- This is the owner of the file, this can be
  589. different from the initiator of the share.
  590. The naming is subobtimal but prevents huge
  591. migration steps -->
  592. <field>
  593. <name>uid_fileowner</name>
  594. <type>text</type>
  595. <default></default>
  596. <notnull>false</notnull>
  597. <length>64</length>
  598. </field>
  599. <!-- Foreign Key share::id or NULL -->
  600. <field>
  601. <name>parent</name>
  602. <type>integer</type>
  603. <notnull>false</notnull>
  604. <length>4</length>
  605. </field>
  606. <!-- E.g. file or folder -->
  607. <field>
  608. <name>item_type</name>
  609. <type>text</type>
  610. <default></default>
  611. <notnull>true</notnull>
  612. <length>64</length>
  613. </field>
  614. <!-- Foreign Key filecache::fileid -->
  615. <field>
  616. <name>item_source</name>
  617. <type>text</type>
  618. <default></default>
  619. <notnull>false</notnull>
  620. <length>255</length>
  621. </field>
  622. <field>
  623. <name>item_target</name>
  624. <type>text</type>
  625. <default></default>
  626. <notnull>false</notnull>
  627. <length>255</length>
  628. </field>
  629. <!-- Foreign Key filecache::fileid -->
  630. <field>
  631. <name>file_source</name>
  632. <type>integer</type>
  633. <notnull>false</notnull>
  634. <length>4</length>
  635. </field>
  636. <field>
  637. <name>file_target</name>
  638. <type>text</type>
  639. <default></default>
  640. <notnull>false</notnull>
  641. <length>512</length>
  642. </field>
  643. <!-- Permission bitfield -->
  644. <field>
  645. <name>permissions</name>
  646. <type>integer</type>
  647. <default>0</default>
  648. <notnull>true</notnull>
  649. <length>1</length>
  650. </field>
  651. <!-- Time of share creation -->
  652. <field>
  653. <name>stime</name>
  654. <type>integer</type>
  655. <default>0</default>
  656. <notnull>true</notnull>
  657. <length>8</length>
  658. </field>
  659. <!-- Whether the receiver accepted the share, if share_with is set. -->
  660. <field>
  661. <name>accepted</name>
  662. <type>integer</type>
  663. <default>0</default>
  664. <notnull>true</notnull>
  665. <length>1</length>
  666. </field>
  667. <!-- Time of share expiration -->
  668. <field>
  669. <name>expiration</name>
  670. <type>timestamp</type>
  671. <default></default>
  672. <notnull>false</notnull>
  673. </field>
  674. <field>
  675. <name>token</name>
  676. <type>text</type>
  677. <default></default>
  678. <notnull>false</notnull>
  679. <length>32</length>
  680. </field>
  681. <field>
  682. <name>mail_send</name>
  683. <type>integer</type>
  684. <default>0</default>
  685. <notnull>true</notnull>
  686. <length>1</length>
  687. </field>
  688. <index>
  689. <name>item_share_type_index</name>
  690. <field>
  691. <name>item_type</name>
  692. <sorting>ascending</sorting>
  693. </field>
  694. <field>
  695. <name>share_type</name>
  696. <sorting>ascending</sorting>
  697. </field>
  698. </index>
  699. <index>
  700. <name>file_source_index</name>
  701. <field>
  702. <name>file_source</name>
  703. <sorting>ascending</sorting>
  704. </field>
  705. </index>
  706. <index>
  707. <name>token_index</name>
  708. <field>
  709. <name>token</name>
  710. <sorting>ascending</sorting>
  711. </field>
  712. </index>
  713. </declaration>
  714. </table>
  715. <table>
  716. <!--
  717. Scheduled background jobs.
  718. See OC\BackgroundJob\JobList.
  719. -->
  720. <name>*dbprefix*jobs</name>
  721. <declaration>
  722. <field>
  723. <name>id</name>
  724. <type>integer</type>
  725. <default>0</default>
  726. <notnull>true</notnull>
  727. <autoincrement>1</autoincrement>
  728. <unsigned>true</unsigned>
  729. <length>4</length>
  730. </field>
  731. <field>
  732. <name>class</name>
  733. <type>text</type>
  734. <default></default>
  735. <notnull>true</notnull>
  736. <length>255</length>
  737. </field>
  738. <field>
  739. <name>argument</name>
  740. <type>text</type>
  741. <default></default>
  742. <notnull>true</notnull>
  743. <length>4000</length>
  744. </field>
  745. <field>
  746. <name>last_run</name>
  747. <type>integer</type>
  748. <default></default>
  749. <notnull>false</notnull>
  750. </field>
  751. <index>
  752. <name>job_class_index</name>
  753. <field>
  754. <name>class</name>
  755. <sorting>ascending</sorting>
  756. </field>
  757. </index>
  758. </declaration>
  759. </table>
  760. <table>
  761. <!--
  762. List of usernames, their display name and login password.
  763. -->
  764. <name>*dbprefix*users</name>
  765. <declaration>
  766. <field>
  767. <name>uid</name>
  768. <type>text</type>
  769. <default></default>
  770. <notnull>true</notnull>
  771. <length>64</length>
  772. </field>
  773. <field>
  774. <name>displayname</name>
  775. <type>text</type>
  776. <default></default>
  777. <length>64</length>
  778. </field>
  779. <field>
  780. <name>password</name>
  781. <type>text</type>
  782. <default></default>
  783. <notnull>true</notnull>
  784. <length>255</length>
  785. </field>
  786. <index>
  787. <name>users_pKey</name>
  788. <primary>true</primary>
  789. <field>
  790. <name>uid</name>
  791. <sorting>ascending</sorting>
  792. </field>
  793. </index>
  794. </declaration>
  795. </table>
  796. <table>
  797. <!--
  798. List of tags (category) + a unique tag id (id) per user (uid) and type.
  799. -->
  800. <name>*dbprefix*vcategory</name>
  801. <declaration>
  802. <field>
  803. <name>id</name>
  804. <type>integer</type>
  805. <default>0</default>
  806. <notnull>true</notnull>
  807. <autoincrement>1</autoincrement>
  808. <unsigned>true</unsigned>
  809. <length>4</length>
  810. </field>
  811. <!-- Foreign Key users::uid -->
  812. <field>
  813. <name>uid</name>
  814. <type>text</type>
  815. <default></default>
  816. <notnull>true</notnull>
  817. <length>64</length>
  818. </field>
  819. <field>
  820. <name>type</name>
  821. <type>text</type>
  822. <default></default>
  823. <notnull>true</notnull>
  824. <length>64</length>
  825. </field>
  826. <field>
  827. <name>category</name>
  828. <type>text</type>
  829. <default></default>
  830. <notnull>true</notnull>
  831. <length>255</length>
  832. </field>
  833. <index>
  834. <name>uid_index</name>
  835. <field>
  836. <name>uid</name>
  837. <sorting>ascending</sorting>
  838. </field>
  839. </index>
  840. <index>
  841. <name>type_index</name>
  842. <field>
  843. <name>type</name>
  844. <sorting>ascending</sorting>
  845. </field>
  846. </index>
  847. <index>
  848. <name>category_index</name>
  849. <field>
  850. <name>category</name>
  851. <sorting>ascending</sorting>
  852. </field>
  853. </index>
  854. </declaration>
  855. </table>
  856. <table>
  857. <!--
  858. Object-Tag associations per tag type.
  859. -->
  860. <name>*dbprefix*vcategory_to_object</name>
  861. <declaration>
  862. <field>
  863. <name>objid</name>
  864. <type>integer</type>
  865. <default>0</default>
  866. <notnull>true</notnull>
  867. <unsigned>true</unsigned>
  868. <length>4</length>
  869. </field>
  870. <!-- Foreign Key vcategory::id -->
  871. <field>
  872. <name>categoryid</name>
  873. <type>integer</type>
  874. <default>0</default>
  875. <notnull>true</notnull>
  876. <unsigned>true</unsigned>
  877. <length>4</length>
  878. </field>
  879. <field>
  880. <name>type</name>
  881. <type>text</type>
  882. <default></default>
  883. <notnull>true</notnull>
  884. <length>64</length>
  885. </field>
  886. <index>
  887. <primary>true</primary>
  888. <unique>true</unique>
  889. <name>category_object_index</name>
  890. <field>
  891. <name>categoryid</name>
  892. <sorting>ascending</sorting>
  893. </field>
  894. <field>
  895. <name>objid</name>
  896. <sorting>ascending</sorting>
  897. </field>
  898. <field>
  899. <name>type</name>
  900. <sorting>ascending</sorting>
  901. </field>
  902. </index>
  903. <index>
  904. <name>vcategory_objectd_index</name>
  905. <field>
  906. <name>objid</name>
  907. <sorting>ascending</sorting>
  908. </field>
  909. <field>
  910. <name>type</name>
  911. <sorting>ascending</sorting>
  912. </field>
  913. </index>
  914. </declaration>
  915. </table>
  916. <table>
  917. <!--
  918. List of system-wide tags
  919. -->
  920. <name>*dbprefix*systemtag</name>
  921. <declaration>
  922. <field>
  923. <name>id</name>
  924. <type>integer</type>
  925. <default>0</default>
  926. <notnull>true</notnull>
  927. <autoincrement>1</autoincrement>
  928. <unsigned>true</unsigned>
  929. <length>4</length>
  930. </field>
  931. <!-- Tag name -->
  932. <field>
  933. <name>name</name>
  934. <type>text</type>
  935. <default></default>
  936. <notnull>true</notnull>
  937. <length>64</length>
  938. </field>
  939. <!-- Visibility: 0 user-not-visible, 1 user-visible -->
  940. <field>
  941. <name>visibility</name>
  942. <type>integer</type>
  943. <default>1</default>
  944. <notnull>true</notnull>
  945. <length>1</length>
  946. </field>
  947. <!-- Editable: 0 user-not-editable, 1 user-editable -->
  948. <field>
  949. <name>editable</name>
  950. <type>integer</type>
  951. <default>1</default>
  952. <notnull>true</notnull>
  953. <length>1</length>
  954. </field>
  955. <index>
  956. <name>tag_ident</name>
  957. <unique>true</unique>
  958. <field>
  959. <name>name</name>
  960. <sorting>ascending</sorting>
  961. </field>
  962. <field>
  963. <name>visibility</name>
  964. <sorting>ascending</sorting>
  965. </field>
  966. <field>
  967. <name>editable</name>
  968. <sorting>ascending</sorting>
  969. </field>
  970. </index>
  971. </declaration>
  972. </table>
  973. <table>
  974. <!--
  975. System tag to object associations per object type.
  976. -->
  977. <name>*dbprefix*systemtag_object_mapping</name>
  978. <declaration>
  979. <!-- object id (ex: file id for files)-->
  980. <field>
  981. <name>objectid</name>
  982. <type>integer</type>
  983. <default>0</default>
  984. <notnull>true</notnull>
  985. <unsigned>true</unsigned>
  986. <length>4</length>
  987. </field>
  988. <!-- object type (ex: "files")-->
  989. <field>
  990. <name>objecttype</name>
  991. <type>text</type>
  992. <default></default>
  993. <notnull>true</notnull>
  994. <length>64</length>
  995. </field>
  996. <!-- Foreign Key systemtag::id -->
  997. <field>
  998. <name>systemtagid</name>
  999. <type>integer</type>
  1000. <default>0</default>
  1001. <notnull>true</notnull>
  1002. <unsigned>true</unsigned>
  1003. <length>4</length>
  1004. </field>
  1005. <index>
  1006. <unique>true</unique>
  1007. <name>mapping</name>
  1008. <field>
  1009. <name>objecttype</name>
  1010. <sorting>ascending</sorting>
  1011. </field>
  1012. <field>
  1013. <name>objectid</name>
  1014. <sorting>ascending</sorting>
  1015. </field>
  1016. <field>
  1017. <name>systemtagid</name>
  1018. <sorting>ascending</sorting>
  1019. </field>
  1020. </index>
  1021. </declaration>
  1022. </table>
  1023. <table>
  1024. <!--
  1025. Namespaced Key-Value Store for arbitrary data.
  1026. - Keys are namespaced per userid and appid.
  1027. - E.g. (admin, files, foo) -> bar
  1028. -->
  1029. <name>*dbprefix*privatedata</name>
  1030. <declaration>
  1031. <field>
  1032. <name>keyid</name>
  1033. <type>integer</type>
  1034. <default>0</default>
  1035. <notnull>true</notnull>
  1036. <unsigned>true</unsigned>
  1037. <length>4</length>
  1038. <autoincrement>1</autoincrement>
  1039. </field>
  1040. <!-- Foreign Key users::uid -->
  1041. <field>
  1042. <name>user</name>
  1043. <type>text</type>
  1044. <default></default>
  1045. <notnull>true</notnull>
  1046. <length>64</length>
  1047. </field>
  1048. <field>
  1049. <name>app</name>
  1050. <type>text</type>
  1051. <default></default>
  1052. <notnull>true</notnull>
  1053. <length>255</length>
  1054. </field>
  1055. <field>
  1056. <name>key</name>
  1057. <type>text</type>
  1058. <default></default>
  1059. <notnull>true</notnull>
  1060. <length>255</length>
  1061. </field>
  1062. <field>
  1063. <name>value</name>
  1064. <type>text</type>
  1065. <default></default>
  1066. <notnull>true</notnull>
  1067. <length>255</length>
  1068. </field>
  1069. <index>
  1070. <primary>true</primary>
  1071. <unique>true</unique>
  1072. <name>keyid_index</name>
  1073. <field>
  1074. <name>keyid</name>
  1075. <sorting>ascending</sorting>
  1076. </field>
  1077. </index>
  1078. </declaration>
  1079. </table>
  1080. <table>
  1081. <!--
  1082. Table for storing transactional file locking
  1083. -->
  1084. <name>*dbprefix*file_locks</name>
  1085. <declaration>
  1086. <field>
  1087. <name>id</name>
  1088. <type>integer</type>
  1089. <default>0</default>
  1090. <notnull>true</notnull>
  1091. <unsigned>true</unsigned>
  1092. <length>4</length>
  1093. <autoincrement>1</autoincrement>
  1094. </field>
  1095. <field>
  1096. <name>lock</name>
  1097. <type>integer</type>
  1098. <default>0</default>
  1099. <notnull>true</notnull>
  1100. <length>4</length>
  1101. </field>
  1102. <field>
  1103. <name>key</name>
  1104. <type>text</type>
  1105. <notnull>true</notnull>
  1106. <length>64</length>
  1107. </field>
  1108. <field>
  1109. <name>ttl</name>
  1110. <type>integer</type>
  1111. <default>-1</default>
  1112. <notnull>true</notnull>
  1113. <length>4</length>
  1114. </field>
  1115. <index>
  1116. <primary>true</primary>
  1117. <unique>true</unique>
  1118. <name>lock_id_index</name>
  1119. <field>
  1120. <name>id</name>
  1121. <sorting>ascending</sorting>
  1122. </field>
  1123. </index>
  1124. <index>
  1125. <unique>true</unique>
  1126. <name>lock_key_index</name>
  1127. <field>
  1128. <name>key</name>
  1129. <sorting>ascending</sorting>
  1130. </field>
  1131. </index>
  1132. <index>
  1133. <name>lock_ttl_index</name>
  1134. <field>
  1135. <name>ttl</name>
  1136. <sorting>ascending</sorting>
  1137. </field>
  1138. </index>
  1139. </declaration>
  1140. </table>
  1141. <table>
  1142. <!--
  1143. default place to store comment data
  1144. -->
  1145. <name>*dbprefix*comments</name>
  1146. <declaration>
  1147. <field>
  1148. <name>id</name>
  1149. <type>integer</type>
  1150. <default>0</default>
  1151. <notnull>true</notnull>
  1152. <unsigned>true</unsigned>
  1153. <length>4</length>
  1154. <autoincrement>1</autoincrement>
  1155. </field>
  1156. <field>
  1157. <name>parent_id</name>
  1158. <type>integer</type>
  1159. <default>0</default>
  1160. <notnull>true</notnull>
  1161. <unsigned>true</unsigned>
  1162. <length>4</length>
  1163. </field>
  1164. <field>
  1165. <name>topmost_parent_id</name>
  1166. <type>integer</type>
  1167. <default>0</default>
  1168. <notnull>true</notnull>
  1169. <unsigned>true</unsigned>
  1170. <length>4</length>
  1171. </field>
  1172. <field>
  1173. <name>children_count</name>
  1174. <type>integer</type>
  1175. <default>0</default>
  1176. <notnull>true</notnull>
  1177. <unsigned>true</unsigned>
  1178. <length>4</length>
  1179. </field>
  1180. <field>
  1181. <name>actor_type</name>
  1182. <type>text</type>
  1183. <default></default>
  1184. <notnull>true</notnull>
  1185. <length>64</length>
  1186. </field>
  1187. <field>
  1188. <name>actor_id</name>
  1189. <type>text</type>
  1190. <default></default>
  1191. <notnull>true</notnull>
  1192. <length>64</length>
  1193. </field>
  1194. <field>
  1195. <name>message</name>
  1196. <type>clob</type>
  1197. <default></default>
  1198. <notnull>false</notnull>
  1199. </field>
  1200. <field>
  1201. <name>verb</name>
  1202. <type>text</type>
  1203. <default></default>
  1204. <notnull>false</notnull>
  1205. <length>64</length>
  1206. </field>
  1207. <field>
  1208. <name>creation_timestamp</name>
  1209. <type>timestamp</type>
  1210. <default></default>
  1211. <notnull>false</notnull>
  1212. </field>
  1213. <field>
  1214. <name>latest_child_timestamp</name>
  1215. <type>timestamp</type>
  1216. <default></default>
  1217. <notnull>false</notnull>
  1218. </field>
  1219. <field>
  1220. <name>object_type</name>
  1221. <type>text</type>
  1222. <default></default>
  1223. <notnull>true</notnull>
  1224. <length>64</length>
  1225. </field>
  1226. <field>
  1227. <name>object_id</name>
  1228. <type>text</type>
  1229. <default></default>
  1230. <notnull>true</notnull>
  1231. <length>64</length>
  1232. </field>
  1233. <!--
  1234. TODO: finalize indexes when all queries are done
  1235. <index>
  1236. <name>comments_parent_id_index</name>
  1237. <unique>false</unique>
  1238. <field>
  1239. <name>parent_id</name>
  1240. <sorting>descending</sorting>
  1241. </field>
  1242. </index>
  1243. <index>
  1244. <name>comments_actor_index</name>
  1245. <unique>false</unique>
  1246. <field>
  1247. <name>actor_type</name>
  1248. <sorting>ascending</sorting>
  1249. </field>
  1250. <field>
  1251. <name>actor_id</name>
  1252. <sorting>ascending</sorting>
  1253. </field>
  1254. </index>
  1255. <index>
  1256. <name>comments_object_index</name>
  1257. <unique>false</unique>
  1258. <field>
  1259. <name>object_type</name>
  1260. <sorting>ascending</sorting>
  1261. </field>
  1262. <field>
  1263. <name>object_id</name>
  1264. <sorting>ascending</sorting>
  1265. </field>
  1266. <field>
  1267. <name>creation_timestamp</name>
  1268. <sorting>descending</sorting>
  1269. </field>
  1270. </index>
  1271. -->
  1272. </declaration>
  1273. </table>
  1274. </database>