db_structure.xml 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  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. <index>
  299. <name>fs_storage_path_hash</name>
  300. <unique>true</unique>
  301. <field>
  302. <name>storage</name>
  303. <sorting>ascending</sorting>
  304. </field>
  305. <field>
  306. <name>path_hash</name>
  307. <sorting>ascending</sorting>
  308. </field>
  309. </index>
  310. <index>
  311. <name>fs_parent_name_hash</name>
  312. <field>
  313. <name>parent</name>
  314. <sorting>ascending</sorting>
  315. </field>
  316. <field>
  317. <name>name</name>
  318. <sorting>ascending</sorting>
  319. </field>
  320. </index>
  321. <index>
  322. <name>fs_storage_mimetype</name>
  323. <field>
  324. <name>storage</name>
  325. <sorting>ascending</sorting>
  326. </field>
  327. <field>
  328. <name>mimetype</name>
  329. <sorting>ascending</sorting>
  330. </field>
  331. </index>
  332. <index>
  333. <name>fs_storage_mimepart</name>
  334. <field>
  335. <name>storage</name>
  336. <sorting>ascending</sorting>
  337. </field>
  338. <field>
  339. <name>mimepart</name>
  340. <sorting>ascending</sorting>
  341. </field>
  342. </index>
  343. <index>
  344. <name>fs_storage_size</name>
  345. <field>
  346. <name>storage</name>
  347. <sorting>ascending</sorting>
  348. </field>
  349. <field>
  350. <name>size</name>
  351. <sorting>ascending</sorting>
  352. </field>
  353. <field>
  354. <name>fileid</name>
  355. </field>
  356. </index>
  357. </declaration>
  358. </table>
  359. <table>
  360. <!--
  361. Maps (fileid, user) to an integer which is a permission bitfield.
  362. - E.g. (4, admin) -> 27
  363. -->
  364. <name>*dbprefix*permissions</name>
  365. <declaration>
  366. <!-- Foreign Key filecache::fileid -->
  367. <field>
  368. <name>fileid</name>
  369. <type>integer</type>
  370. <default>0</default>
  371. <notnull>true</notnull>
  372. <length>4</length>
  373. </field>
  374. <!-- Foreign Key users::uid -->
  375. <field>
  376. <name>user</name>
  377. <type>text</type>
  378. <default></default>
  379. <notnull>false</notnull>
  380. <length>64</length>
  381. </field>
  382. <field>
  383. <name>permissions</name>
  384. <type>integer</type>
  385. <default>0</default>
  386. <notnull>true</notnull>
  387. <length>4</length>
  388. </field>
  389. <index>
  390. <name>id_user_index</name>
  391. <field>
  392. <name>fileid</name>
  393. <sorting>ascending</sorting>
  394. </field>
  395. <field>
  396. <name>user</name>
  397. <sorting>ascending</sorting>
  398. </field>
  399. </index>
  400. </declaration>
  401. </table>
  402. <table>
  403. <!--
  404. Stores which groups have which users as members in an n:m relationship.
  405. - Maps group id (gid) to a set of users (uid)
  406. - Maps user id (uid) to a set of groups (gid) (but without index)
  407. -->
  408. <name>*dbprefix*group_user</name>
  409. <declaration>
  410. <!-- Foreign Key groups::gid -->
  411. <field>
  412. <name>gid</name>
  413. <type>text</type>
  414. <default></default>
  415. <notnull>true</notnull>
  416. <length>64</length>
  417. </field>
  418. <!-- Foreign Key users::uid -->
  419. <field>
  420. <name>uid</name>
  421. <type>text</type>
  422. <default></default>
  423. <notnull>true</notnull>
  424. <length>64</length>
  425. </field>
  426. <index>
  427. <name>gu_gid_uid_index</name>
  428. <primary>true</primary>
  429. <unique>true</unique>
  430. <field>
  431. <name>gid</name>
  432. <sorting>ascending</sorting>
  433. </field>
  434. <field>
  435. <name>uid</name>
  436. <sorting>ascending</sorting>
  437. </field>
  438. </index>
  439. </declaration>
  440. </table>
  441. <table>
  442. <!--
  443. Stores which groups have which users as admins in an n:m relationship.
  444. - Maps group id (gid) to a set of users (uid)
  445. - Maps user id (uid) to a set of groups (gid)
  446. NOTE: This could (very likely) be reduced to a single bit in group_user
  447. instead of repeating varchars gid and uid here
  448. -->
  449. <name>*dbprefix*group_admin</name>
  450. <declaration>
  451. <!-- Foreign Key groups::gid -->
  452. <field>
  453. <name>gid</name>
  454. <type>text</type>
  455. <default></default>
  456. <notnull>true</notnull>
  457. <length>64</length>
  458. </field>
  459. <!-- Foreign Key users::uid -->
  460. <field>
  461. <name>uid</name>
  462. <type>text</type>
  463. <default></default>
  464. <notnull>true</notnull>
  465. <length>64</length>
  466. </field>
  467. <index>
  468. <name>group_admin_uid</name>
  469. <field>
  470. <name>uid</name>
  471. <sorting>ascending</sorting>
  472. </field>
  473. </index>
  474. <index>
  475. <name>ga_gid_uid_index</name>
  476. <primary>true</primary>
  477. <unique>true</unique>
  478. <field>
  479. <name>gid</name>
  480. <sorting>ascending</sorting>
  481. </field>
  482. <field>
  483. <name>uid</name>
  484. <sorting>ascending</sorting>
  485. </field>
  486. </index>
  487. </declaration>
  488. </table>
  489. <table>
  490. <!--
  491. A simple list of groups.
  492. -->
  493. <name>*dbprefix*groups</name>
  494. <declaration>
  495. <field>
  496. <name>gid</name>
  497. <type>text</type>
  498. <default></default>
  499. <notnull>true</notnull>
  500. <length>64</length>
  501. </field>
  502. <index>
  503. <name>groups_pKey</name>
  504. <primary>true</primary>
  505. <field>
  506. <name>gid</name>
  507. <sorting>ascending</sorting>
  508. </field>
  509. </index>
  510. </declaration>
  511. </table>
  512. <table>
  513. <!--
  514. Locks held by WebDAV clients via OC_Connector_Sabre_Locks.
  515. -->
  516. <name>*dbprefix*locks</name>
  517. <declaration>
  518. <field>
  519. <name>id</name>
  520. <type>integer</type>
  521. <default>0</default>
  522. <notnull>true</notnull>
  523. <autoincrement>1</autoincrement>
  524. <unsigned>true</unsigned>
  525. <length>4</length>
  526. </field>
  527. <!-- Foreign Key users::uid -->
  528. <field>
  529. <name>userid</name>
  530. <type>text</type>
  531. <default></default>
  532. <notnull>false</notnull>
  533. <length>64</length>
  534. </field>
  535. <field>
  536. <name>owner</name>
  537. <type>text</type>
  538. <default></default>
  539. <notnull>false</notnull>
  540. <length>100</length>
  541. </field>
  542. <field>
  543. <name>timeout</name>
  544. <type>integer</type>
  545. <notnull>false</notnull>
  546. <unsigned>true</unsigned>
  547. <length>4</length>
  548. </field>
  549. <field>
  550. <name>created</name>
  551. <type>integer</type>
  552. <notnull>false</notnull>
  553. <length>8</length>
  554. </field>
  555. <field>
  556. <name>token</name>
  557. <type>text</type>
  558. <default></default>
  559. <notnull>false</notnull>
  560. <length>100</length>
  561. </field>
  562. <field>
  563. <name>scope</name>
  564. <type>integer</type>
  565. <notnull>false</notnull>
  566. <length>1</length>
  567. </field>
  568. <field>
  569. <name>depth</name>
  570. <type>integer</type>
  571. <notnull>false</notnull>
  572. <length>1</length>
  573. </field>
  574. <field>
  575. <name>uri</name>
  576. <type>clob</type>
  577. <notnull>false</notnull>
  578. </field>
  579. </declaration>
  580. </table>
  581. <table>
  582. <!--
  583. Namespaced Key-Value Store for User Preferences
  584. - Keys are namespaced per userid and appid.
  585. - E.g. (admin, files, cache_version) -> 5
  586. -->
  587. <name>*dbprefix*preferences</name>
  588. <declaration>
  589. <!-- Foreign Key users::uid -->
  590. <field>
  591. <name>userid</name>
  592. <type>text</type>
  593. <default></default>
  594. <notnull>true</notnull>
  595. <length>64</length>
  596. </field>
  597. <field>
  598. <name>appid</name>
  599. <type>text</type>
  600. <default></default>
  601. <notnull>true</notnull>
  602. <length>32</length>
  603. </field>
  604. <field>
  605. <name>configkey</name>
  606. <type>text</type>
  607. <default></default>
  608. <notnull>true</notnull>
  609. <length>64</length>
  610. </field>
  611. <field>
  612. <name>configvalue</name>
  613. <type>clob</type>
  614. <notnull>false</notnull>
  615. </field>
  616. <index>
  617. <name>pref_userid_appid_key_index</name>
  618. <primary>true</primary>
  619. <unique>true</unique>
  620. <field>
  621. <name>userid</name>
  622. <sorting>ascending</sorting>
  623. </field>
  624. <field>
  625. <name>appid</name>
  626. <sorting>ascending</sorting>
  627. </field>
  628. <field>
  629. <name>configkey</name>
  630. <sorting>ascending</sorting>
  631. </field>
  632. </index>
  633. </declaration>
  634. </table>
  635. <table>
  636. <!--
  637. WebDAV properties.
  638. -->
  639. <name>*dbprefix*properties</name>
  640. <declaration>
  641. <field>
  642. <name>id</name>
  643. <autoincrement>1</autoincrement>
  644. <type>integer</type>
  645. <default>0</default>
  646. <notnull>true</notnull>
  647. <length>4</length>
  648. </field>
  649. <!-- Foreign Key users::uid -->
  650. <field>
  651. <name>userid</name>
  652. <type>text</type>
  653. <default></default>
  654. <notnull>true</notnull>
  655. <length>64</length>
  656. </field>
  657. <field>
  658. <name>propertypath</name>
  659. <type>text</type>
  660. <default></default>
  661. <notnull>true</notnull>
  662. <length>255</length>
  663. </field>
  664. <field>
  665. <name>propertyname</name>
  666. <type>text</type>
  667. <default></default>
  668. <notnull>true</notnull>
  669. <length>255</length>
  670. </field>
  671. <field>
  672. <name>propertyvalue</name>
  673. <type>text</type>
  674. <notnull>true</notnull>
  675. <length>255</length>
  676. </field>
  677. <index>
  678. <name>property_index</name>
  679. <field>
  680. <name>userid</name>
  681. <sorting>ascending</sorting>
  682. </field>
  683. </index>
  684. </declaration>
  685. </table>
  686. <table>
  687. <!--
  688. Shares of all types (user-to-user, external-via-link, etc.)
  689. -->
  690. <name>*dbprefix*share</name>
  691. <declaration>
  692. <field>
  693. <name>id</name>
  694. <autoincrement>1</autoincrement>
  695. <type>integer</type>
  696. <default>0</default>
  697. <notnull>true</notnull>
  698. <length>4</length>
  699. </field>
  700. <!-- Constant OCP\Share::SHARE_TYPE_* -->
  701. <field>
  702. <name>share_type</name>
  703. <type>integer</type>
  704. <default>0</default>
  705. <notnull>true</notnull>
  706. <length>1</length>
  707. </field>
  708. <!-- Foreign Key users::uid or NULL -->
  709. <field>
  710. <name>share_with</name>
  711. <type>text</type>
  712. <default></default>
  713. <notnull>false</notnull>
  714. <length>255</length>
  715. </field>
  716. <!-- Foreign Key users::uid -->
  717. <field>
  718. <name>uid_owner</name>
  719. <type>text</type>
  720. <default></default>
  721. <notnull>true</notnull>
  722. <length>255</length>
  723. </field>
  724. <!-- Foreign Key share::id or NULL -->
  725. <field>
  726. <name>parent</name>
  727. <type>integer</type>
  728. <notnull>false</notnull>
  729. <length>4</length>
  730. </field>
  731. <!-- E.g. file or folder -->
  732. <field>
  733. <name>item_type</name>
  734. <type>text</type>
  735. <default></default>
  736. <notnull>true</notnull>
  737. <length>64</length>
  738. </field>
  739. <!-- Foreign Key filecache::fileid -->
  740. <field>
  741. <name>item_source</name>
  742. <type>text</type>
  743. <default></default>
  744. <notnull>false</notnull>
  745. <length>255</length>
  746. </field>
  747. <field>
  748. <name>item_target</name>
  749. <type>text</type>
  750. <default></default>
  751. <notnull>false</notnull>
  752. <length>255</length>
  753. </field>
  754. <!-- Foreign Key filecache::fileid -->
  755. <field>
  756. <name>file_source</name>
  757. <type>integer</type>
  758. <notnull>false</notnull>
  759. <length>4</length>
  760. </field>
  761. <field>
  762. <name>file_target</name>
  763. <type>text</type>
  764. <default></default>
  765. <notnull>false</notnull>
  766. <length>512</length>
  767. </field>
  768. <!-- Permission bitfield -->
  769. <field>
  770. <name>permissions</name>
  771. <type>integer</type>
  772. <default>0</default>
  773. <notnull>true</notnull>
  774. <length>1</length>
  775. </field>
  776. <!-- Time of share creation -->
  777. <field>
  778. <name>stime</name>
  779. <type>integer</type>
  780. <default>0</default>
  781. <notnull>true</notnull>
  782. <length>8</length>
  783. </field>
  784. <!-- Whether the receiver accepted the share, if share_with is set. -->
  785. <field>
  786. <name>accepted</name>
  787. <type>integer</type>
  788. <default>0</default>
  789. <notnull>true</notnull>
  790. <length>1</length>
  791. </field>
  792. <!-- Time of share expiration -->
  793. <field>
  794. <name>expiration</name>
  795. <type>timestamp</type>
  796. <default></default>
  797. <notnull>false</notnull>
  798. </field>
  799. <field>
  800. <name>token</name>
  801. <type>text</type>
  802. <default></default>
  803. <notnull>false</notnull>
  804. <length>32</length>
  805. </field>
  806. <field>
  807. <name>mail_send</name>
  808. <type>integer</type>
  809. <default>0</default>
  810. <notnull>true</notnull>
  811. <length>1</length>
  812. </field>
  813. <index>
  814. <name>item_share_type_index</name>
  815. <field>
  816. <name>item_type</name>
  817. <sorting>ascending</sorting>
  818. </field>
  819. <field>
  820. <name>share_type</name>
  821. <sorting>ascending</sorting>
  822. </field>
  823. </index>
  824. <index>
  825. <name>file_source_index</name>
  826. <field>
  827. <name>file_source</name>
  828. <sorting>ascending</sorting>
  829. </field>
  830. </index>
  831. <index>
  832. <name>token_index</name>
  833. <field>
  834. <name>token</name>
  835. <sorting>ascending</sorting>
  836. </field>
  837. </index>
  838. <index>
  839. <name>file_target_index</name>
  840. <field>
  841. <name>file_target</name>
  842. </field>
  843. <field>
  844. <name>uid_owner</name>
  845. </field>
  846. <field>
  847. <name>share_type</name>
  848. </field>
  849. </index>
  850. </declaration>
  851. </table>
  852. <table>
  853. <!--
  854. Scheduled background jobs.
  855. See OC\BackgroundJob\JobList.
  856. -->
  857. <name>*dbprefix*jobs</name>
  858. <declaration>
  859. <field>
  860. <name>id</name>
  861. <type>integer</type>
  862. <default>0</default>
  863. <notnull>true</notnull>
  864. <autoincrement>1</autoincrement>
  865. <unsigned>true</unsigned>
  866. <length>4</length>
  867. </field>
  868. <field>
  869. <name>class</name>
  870. <type>text</type>
  871. <default></default>
  872. <notnull>true</notnull>
  873. <length>255</length>
  874. </field>
  875. <field>
  876. <name>argument</name>
  877. <type>text</type>
  878. <default></default>
  879. <notnull>true</notnull>
  880. <length>256</length>
  881. </field>
  882. <field>
  883. <name>last_run</name>
  884. <type>integer</type>
  885. <default></default>
  886. <notnull>false</notnull>
  887. </field>
  888. <index>
  889. <name>job_class_index</name>
  890. <field>
  891. <name>class</name>
  892. <sorting>ascending</sorting>
  893. </field>
  894. </index>
  895. </declaration>
  896. </table>
  897. <table>
  898. <!--
  899. List of usernames, their display name and login password.
  900. -->
  901. <name>*dbprefix*users</name>
  902. <declaration>
  903. <field>
  904. <name>uid</name>
  905. <type>text</type>
  906. <default></default>
  907. <notnull>true</notnull>
  908. <length>64</length>
  909. </field>
  910. <field>
  911. <name>displayname</name>
  912. <type>text</type>
  913. <default></default>
  914. <length>64</length>
  915. </field>
  916. <field>
  917. <name>password</name>
  918. <type>text</type>
  919. <default></default>
  920. <notnull>true</notnull>
  921. <length>255</length>
  922. </field>
  923. <index>
  924. <name>users_pKey</name>
  925. <primary>true</primary>
  926. <field>
  927. <name>uid</name>
  928. <sorting>ascending</sorting>
  929. </field>
  930. </index>
  931. </declaration>
  932. </table>
  933. <table>
  934. <!--
  935. List of tags (category) + a unique tag id (id) per user (uid) and type.
  936. -->
  937. <name>*dbprefix*vcategory</name>
  938. <declaration>
  939. <field>
  940. <name>id</name>
  941. <type>integer</type>
  942. <default>0</default>
  943. <notnull>true</notnull>
  944. <autoincrement>1</autoincrement>
  945. <unsigned>true</unsigned>
  946. <length>4</length>
  947. </field>
  948. <!-- Foreign Key users::uid -->
  949. <field>
  950. <name>uid</name>
  951. <type>text</type>
  952. <default></default>
  953. <notnull>true</notnull>
  954. <length>64</length>
  955. </field>
  956. <field>
  957. <name>type</name>
  958. <type>text</type>
  959. <default></default>
  960. <notnull>true</notnull>
  961. <length>64</length>
  962. </field>
  963. <field>
  964. <name>category</name>
  965. <type>text</type>
  966. <default></default>
  967. <notnull>true</notnull>
  968. <length>255</length>
  969. </field>
  970. <index>
  971. <name>uid_index</name>
  972. <field>
  973. <name>uid</name>
  974. <sorting>ascending</sorting>
  975. </field>
  976. </index>
  977. <index>
  978. <name>type_index</name>
  979. <field>
  980. <name>type</name>
  981. <sorting>ascending</sorting>
  982. </field>
  983. </index>
  984. <index>
  985. <name>category_index</name>
  986. <field>
  987. <name>category</name>
  988. <sorting>ascending</sorting>
  989. </field>
  990. </index>
  991. </declaration>
  992. </table>
  993. <table>
  994. <!--
  995. Object-Tag associations per tag type.
  996. -->
  997. <name>*dbprefix*vcategory_to_object</name>
  998. <declaration>
  999. <field>
  1000. <name>objid</name>
  1001. <type>integer</type>
  1002. <default>0</default>
  1003. <notnull>true</notnull>
  1004. <unsigned>true</unsigned>
  1005. <length>4</length>
  1006. </field>
  1007. <!-- Foreign Key vcategory::id -->
  1008. <field>
  1009. <name>categoryid</name>
  1010. <type>integer</type>
  1011. <default>0</default>
  1012. <notnull>true</notnull>
  1013. <unsigned>true</unsigned>
  1014. <length>4</length>
  1015. </field>
  1016. <field>
  1017. <name>type</name>
  1018. <type>text</type>
  1019. <default></default>
  1020. <notnull>true</notnull>
  1021. <length>64</length>
  1022. </field>
  1023. <index>
  1024. <primary>true</primary>
  1025. <unique>true</unique>
  1026. <name>category_object_index</name>
  1027. <field>
  1028. <name>categoryid</name>
  1029. <sorting>ascending</sorting>
  1030. </field>
  1031. <field>
  1032. <name>objid</name>
  1033. <sorting>ascending</sorting>
  1034. </field>
  1035. <field>
  1036. <name>type</name>
  1037. <sorting>ascending</sorting>
  1038. </field>
  1039. </index>
  1040. <index>
  1041. <name>vcategory_objectd_index</name>
  1042. <field>
  1043. <name>objid</name>
  1044. <sorting>ascending</sorting>
  1045. </field>
  1046. <field>
  1047. <name>type</name>
  1048. <sorting>ascending</sorting>
  1049. </field>
  1050. </index>
  1051. </declaration>
  1052. </table>
  1053. <table>
  1054. <!--
  1055. Namespaced Key-Value Store for arbitrary data.
  1056. - Keys are namespaced per userid and appid.
  1057. - E.g. (admin, files, foo) -> bar
  1058. -->
  1059. <name>*dbprefix*privatedata</name>
  1060. <declaration>
  1061. <field>
  1062. <name>keyid</name>
  1063. <type>integer</type>
  1064. <default>0</default>
  1065. <notnull>true</notnull>
  1066. <unsigned>true</unsigned>
  1067. <length>4</length>
  1068. <autoincrement>1</autoincrement>
  1069. </field>
  1070. <!-- Foreign Key users::uid -->
  1071. <field>
  1072. <name>user</name>
  1073. <type>text</type>
  1074. <default></default>
  1075. <notnull>true</notnull>
  1076. <length>255</length>
  1077. </field>
  1078. <field>
  1079. <name>app</name>
  1080. <type>text</type>
  1081. <default></default>
  1082. <notnull>true</notnull>
  1083. <length>255</length>
  1084. </field>
  1085. <field>
  1086. <name>key</name>
  1087. <type>text</type>
  1088. <default></default>
  1089. <notnull>true</notnull>
  1090. <length>255</length>
  1091. </field>
  1092. <field>
  1093. <name>value</name>
  1094. <type>text</type>
  1095. <default></default>
  1096. <notnull>true</notnull>
  1097. <length>255</length>
  1098. </field>
  1099. <index>
  1100. <primary>true</primary>
  1101. <unique>true</unique>
  1102. <name>keyid_index</name>
  1103. <field>
  1104. <name>keyid</name>
  1105. <sorting>ascending</sorting>
  1106. </field>
  1107. </index>
  1108. </declaration>
  1109. </table>
  1110. </database>