db_structure.xml 24 KB

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