db_structure.xml 22 KB

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