db_structure.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  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>