db_structure.xml 23 KB

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