db_structure.xml 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110
  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. <field>
  89. <name>available</name>
  90. <type>integer</type>
  91. <default>1</default>
  92. <notnull>true</notnull>
  93. </field>
  94. <field>
  95. <name>last_checked</name>
  96. <type>integer</type>
  97. </field>
  98. <index>
  99. <name>storages_id_index</name>
  100. <unique>true</unique>
  101. <field>
  102. <name>id</name>
  103. <sorting>ascending</sorting>
  104. </field>
  105. </index>
  106. </declaration>
  107. </table>
  108. <!-- a list of all mounted storage per user, populated on filesystem setup -->
  109. <table>
  110. <name>*dbprefix*mounts</name>
  111. <declaration>
  112. <field>
  113. <name>id</name>
  114. <type>integer</type>
  115. <default>0</default>
  116. <notnull>true</notnull>
  117. <autoincrement>1</autoincrement>
  118. <length>4</length>
  119. </field>
  120. <field>
  121. <name>storage_id</name>
  122. <type>integer</type>
  123. <notnull>true</notnull>
  124. </field>
  125. <!-- fileid of the root of the mount, foreign key: oc_filecache.fileid -->
  126. <field>
  127. <name>root_id</name>
  128. <type>integer</type>
  129. <notnull>true</notnull>
  130. </field>
  131. <field>
  132. <name>user_id</name>
  133. <type>text</type>
  134. <notnull>true</notnull>
  135. <length>64</length>
  136. </field>
  137. <field>
  138. <name>mount_point</name>
  139. <type>text</type>
  140. <notnull>true</notnull>
  141. <length>4000</length>
  142. </field>
  143. <field>
  144. <name>mount_id</name>
  145. <type>integer</type>
  146. </field>
  147. <index>
  148. <name>mounts_user_index</name>
  149. <unique>false</unique>
  150. <field>
  151. <name>user_id</name>
  152. <sorting>ascending</sorting>
  153. </field>
  154. </index>
  155. <index>
  156. <name>mounts_storage_index</name>
  157. <unique>false</unique>
  158. <field>
  159. <name>storage_id</name>
  160. <sorting>ascending</sorting>
  161. </field>
  162. </index>
  163. <index>
  164. <name>mounts_root_index</name>
  165. <unique>false</unique>
  166. <field>
  167. <name>root_id</name>
  168. <sorting>ascending</sorting>
  169. </field>
  170. </index>
  171. <index>
  172. <name>mounts_mount_id_index</name>
  173. <unique>false</unique>
  174. <field>
  175. <name>mount_id</name>
  176. <sorting>ascending</sorting>
  177. </field>
  178. </index>
  179. <index>
  180. <name>mounts_user_root_index</name>
  181. <unique>true</unique>
  182. <field>
  183. <name>user_id</name>
  184. <sorting>ascending</sorting>
  185. </field>
  186. <field>
  187. <name>root_id</name>
  188. <sorting>ascending</sorting>
  189. </field>
  190. </index>
  191. </declaration>
  192. </table>
  193. <table>
  194. <!--
  195. Bidirectional Map for Mimetypes and Mimetype Id
  196. - Assigns each mimetype (and supertype) a unique mimetype id integer.
  197. - E.g. application <-> 5
  198. - E.g. application/pdf <-> 6
  199. -->
  200. <name>*dbprefix*mimetypes</name>
  201. <declaration>
  202. <field>
  203. <name>id</name>
  204. <type>integer</type>
  205. <default>0</default>
  206. <notnull>true</notnull>
  207. <autoincrement>1</autoincrement>
  208. <length>4</length>
  209. </field>
  210. <field>
  211. <name>mimetype</name>
  212. <type>text</type>
  213. <default></default>
  214. <notnull>true</notnull>
  215. <length>255</length>
  216. </field>
  217. <index>
  218. <name>mimetype_id_index</name>
  219. <unique>true</unique>
  220. <field>
  221. <name>mimetype</name>
  222. <sorting>ascending</sorting>
  223. </field>
  224. </index>
  225. </declaration>
  226. </table>
  227. <table>
  228. <!--
  229. Main file table containing one row for each directory and file.
  230. - Assigns a unique integer fileid to each file (and directory)
  231. - Assigns an etag to each file (and directory)
  232. - Caches various file/dir properties such as:
  233. - path (filename, e.g. files/combinatoricslib-2.0_doc.zip)
  234. - path_hash = md5(path)
  235. - name (basename, e.g. combinatoricslib-2.0_doc.zip)
  236. - size (for directories this is the sum of all contained file sizes)
  237. -->
  238. <name>*dbprefix*filecache</name>
  239. <declaration>
  240. <field>
  241. <name>fileid</name>
  242. <type>integer</type>
  243. <default>0</default>
  244. <notnull>true</notnull>
  245. <autoincrement>1</autoincrement>
  246. <length>4</length>
  247. </field>
  248. <!-- Foreign Key storages::numeric_id -->
  249. <field>
  250. <name>storage</name>
  251. <type>integer</type>
  252. <default></default>
  253. <notnull>true</notnull>
  254. <length>4</length>
  255. </field>
  256. <field>
  257. <name>path</name>
  258. <type>text</type>
  259. <default></default>
  260. <notnull>false</notnull>
  261. <length>4000</length>
  262. </field>
  263. <field>
  264. <name>path_hash</name>
  265. <type>text</type>
  266. <default></default>
  267. <notnull>true</notnull>
  268. <length>32</length>
  269. </field>
  270. <!-- Foreign Key filecache::fileid -->
  271. <field>
  272. <name>parent</name>
  273. <type>integer</type>
  274. <default></default>
  275. <notnull>true</notnull>
  276. <length>4</length>
  277. </field>
  278. <field>
  279. <name>name</name>
  280. <type>text</type>
  281. <default></default>
  282. <notnull>false</notnull>
  283. <length>250</length>
  284. </field>
  285. <!-- Foreign Key mimetypes::id -->
  286. <field>
  287. <name>mimetype</name>
  288. <type>integer</type>
  289. <default></default>
  290. <notnull>true</notnull>
  291. <length>4</length>
  292. </field>
  293. <!-- Foreign Key mimetypes::id -->
  294. <field>
  295. <name>mimepart</name>
  296. <type>integer</type>
  297. <default></default>
  298. <notnull>true</notnull>
  299. <length>4</length>
  300. </field>
  301. <field>
  302. <name>size</name>
  303. <type>integer</type>
  304. <default></default>
  305. <notnull>true</notnull>
  306. <length>8</length>
  307. </field>
  308. <field>
  309. <name>mtime</name>
  310. <type>integer</type>
  311. <default></default>
  312. <notnull>true</notnull>
  313. <length>4</length>
  314. </field>
  315. <field>
  316. <name>storage_mtime</name>
  317. <type>integer</type>
  318. <default></default>
  319. <notnull>true</notnull>
  320. <length>4</length>
  321. </field>
  322. <field>
  323. <name>encrypted</name>
  324. <type>integer</type>
  325. <default>0</default>
  326. <notnull>true</notnull>
  327. <length>4</length>
  328. </field>
  329. <field>
  330. <name>unencrypted_size</name>
  331. <type>integer</type>
  332. <default>0</default>
  333. <notnull>true</notnull>
  334. <length>8</length>
  335. </field>
  336. <field>
  337. <name>etag</name>
  338. <type>text</type>
  339. <default></default>
  340. <notnull>false</notnull>
  341. <length>40</length>
  342. </field>
  343. <field>
  344. <name>permissions</name>
  345. <type>integer</type>
  346. <default>0</default>
  347. <notnull>false</notnull>
  348. <length>4</length>
  349. </field>
  350. <field>
  351. <name>checksum</name>
  352. <type>text</type>
  353. <default></default>
  354. <notnull>false</notnull>
  355. <length>255</length>
  356. </field>
  357. <index>
  358. <name>fs_storage_path_hash</name>
  359. <unique>true</unique>
  360. <field>
  361. <name>storage</name>
  362. <sorting>ascending</sorting>
  363. </field>
  364. <field>
  365. <name>path_hash</name>
  366. <sorting>ascending</sorting>
  367. </field>
  368. </index>
  369. <index>
  370. <name>fs_parent_name_hash</name>
  371. <field>
  372. <name>parent</name>
  373. <sorting>ascending</sorting>
  374. </field>
  375. <field>
  376. <name>name</name>
  377. <sorting>ascending</sorting>
  378. </field>
  379. </index>
  380. <index>
  381. <name>fs_storage_mimetype</name>
  382. <field>
  383. <name>storage</name>
  384. <sorting>ascending</sorting>
  385. </field>
  386. <field>
  387. <name>mimetype</name>
  388. <sorting>ascending</sorting>
  389. </field>
  390. </index>
  391. <index>
  392. <name>fs_storage_mimepart</name>
  393. <field>
  394. <name>storage</name>
  395. <sorting>ascending</sorting>
  396. </field>
  397. <field>
  398. <name>mimepart</name>
  399. <sorting>ascending</sorting>
  400. </field>
  401. </index>
  402. <index>
  403. <name>fs_storage_size</name>
  404. <field>
  405. <name>storage</name>
  406. <sorting>ascending</sorting>
  407. </field>
  408. <field>
  409. <name>size</name>
  410. <sorting>ascending</sorting>
  411. </field>
  412. <field>
  413. <name>fileid</name>
  414. </field>
  415. </index>
  416. </declaration>
  417. </table>
  418. <table>
  419. <!--
  420. Stores which groups have which users as members in an n:m relationship.
  421. - Maps group id (gid) to a set of users (uid)
  422. - Maps user id (uid) to a set of groups (gid) (but without index)
  423. -->
  424. <name>*dbprefix*group_user</name>
  425. <declaration>
  426. <!-- Foreign Key groups::gid -->
  427. <field>
  428. <name>gid</name>
  429. <type>text</type>
  430. <default></default>
  431. <notnull>true</notnull>
  432. <length>64</length>
  433. </field>
  434. <!-- Foreign Key users::uid -->
  435. <field>
  436. <name>uid</name>
  437. <type>text</type>
  438. <default></default>
  439. <notnull>true</notnull>
  440. <length>64</length>
  441. </field>
  442. <index>
  443. <name>gu_gid_uid_index</name>
  444. <primary>true</primary>
  445. <unique>true</unique>
  446. <field>
  447. <name>gid</name>
  448. <sorting>ascending</sorting>
  449. </field>
  450. <field>
  451. <name>uid</name>
  452. <sorting>ascending</sorting>
  453. </field>
  454. </index>
  455. <index>
  456. <name>gu_uid_index</name>
  457. <field>
  458. <name>uid</name>
  459. <sorting>ascending</sorting>
  460. </field>
  461. </index>
  462. </declaration>
  463. </table>
  464. <table>
  465. <!--
  466. Stores which groups have which users as admins in an n:m relationship.
  467. - Maps group id (gid) to a set of users (uid)
  468. - Maps user id (uid) to a set of groups (gid)
  469. NOTE: This could (very likely) be reduced to a single bit in group_user
  470. instead of repeating varchars gid and uid here
  471. -->
  472. <name>*dbprefix*group_admin</name>
  473. <declaration>
  474. <!-- Foreign Key groups::gid -->
  475. <field>
  476. <name>gid</name>
  477. <type>text</type>
  478. <default></default>
  479. <notnull>true</notnull>
  480. <length>64</length>
  481. </field>
  482. <!-- Foreign Key users::uid -->
  483. <field>
  484. <name>uid</name>
  485. <type>text</type>
  486. <default></default>
  487. <notnull>true</notnull>
  488. <length>64</length>
  489. </field>
  490. <index>
  491. <name>group_admin_uid</name>
  492. <field>
  493. <name>uid</name>
  494. <sorting>ascending</sorting>
  495. </field>
  496. </index>
  497. <index>
  498. <name>ga_gid_uid_index</name>
  499. <primary>true</primary>
  500. <unique>true</unique>
  501. <field>
  502. <name>gid</name>
  503. <sorting>ascending</sorting>
  504. </field>
  505. <field>
  506. <name>uid</name>
  507. <sorting>ascending</sorting>
  508. </field>
  509. </index>
  510. </declaration>
  511. </table>
  512. <table>
  513. <!--
  514. A simple list of groups.
  515. -->
  516. <name>*dbprefix*groups</name>
  517. <declaration>
  518. <field>
  519. <name>gid</name>
  520. <type>text</type>
  521. <default></default>
  522. <notnull>true</notnull>
  523. <length>64</length>
  524. </field>
  525. <index>
  526. <name>groups_pKey</name>
  527. <primary>true</primary>
  528. <field>
  529. <name>gid</name>
  530. <sorting>ascending</sorting>
  531. </field>
  532. </index>
  533. </declaration>
  534. </table>
  535. <table>
  536. <!--
  537. Namespaced Key-Value Store for User Preferences
  538. - Keys are namespaced per userid and appid.
  539. - E.g. (admin, files, cache_version) -> 5
  540. -->
  541. <name>*dbprefix*preferences</name>
  542. <declaration>
  543. <!-- Foreign Key users::uid -->
  544. <field>
  545. <name>userid</name>
  546. <type>text</type>
  547. <default></default>
  548. <notnull>true</notnull>
  549. <length>64</length>
  550. </field>
  551. <field>
  552. <name>appid</name>
  553. <type>text</type>
  554. <default></default>
  555. <notnull>true</notnull>
  556. <length>32</length>
  557. </field>
  558. <field>
  559. <name>configkey</name>
  560. <type>text</type>
  561. <default></default>
  562. <notnull>true</notnull>
  563. <length>64</length>
  564. </field>
  565. <field>
  566. <name>configvalue</name>
  567. <type>clob</type>
  568. <notnull>false</notnull>
  569. </field>
  570. <index>
  571. <name>pref_userid_appid_key_index</name>
  572. <primary>true</primary>
  573. <unique>true</unique>
  574. <field>
  575. <name>userid</name>
  576. <sorting>ascending</sorting>
  577. </field>
  578. <field>
  579. <name>appid</name>
  580. <sorting>ascending</sorting>
  581. </field>
  582. <field>
  583. <name>configkey</name>
  584. <sorting>ascending</sorting>
  585. </field>
  586. </index>
  587. </declaration>
  588. </table>
  589. <table>
  590. <!--
  591. WebDAV properties.
  592. -->
  593. <name>*dbprefix*properties</name>
  594. <declaration>
  595. <field>
  596. <name>id</name>
  597. <autoincrement>1</autoincrement>
  598. <type>integer</type>
  599. <default>0</default>
  600. <notnull>true</notnull>
  601. <length>4</length>
  602. </field>
  603. <!-- Foreign Key users::uid -->
  604. <field>
  605. <name>userid</name>
  606. <type>text</type>
  607. <default></default>
  608. <notnull>true</notnull>
  609. <length>64</length>
  610. </field>
  611. <field>
  612. <name>propertypath</name>
  613. <type>text</type>
  614. <default></default>
  615. <notnull>true</notnull>
  616. <length>255</length>
  617. </field>
  618. <field>
  619. <name>propertyname</name>
  620. <type>text</type>
  621. <default></default>
  622. <notnull>true</notnull>
  623. <length>255</length>
  624. </field>
  625. <field>
  626. <name>propertyvalue</name>
  627. <type>text</type>
  628. <notnull>true</notnull>
  629. <length>255</length>
  630. </field>
  631. <index>
  632. <name>property_index</name>
  633. <field>
  634. <name>userid</name>
  635. <sorting>ascending</sorting>
  636. </field>
  637. </index>
  638. </declaration>
  639. </table>
  640. <table>
  641. <!--
  642. Shares of all types (user-to-user, external-via-link, etc.)
  643. -->
  644. <name>*dbprefix*share</name>
  645. <declaration>
  646. <field>
  647. <name>id</name>
  648. <autoincrement>1</autoincrement>
  649. <type>integer</type>
  650. <default>0</default>
  651. <notnull>true</notnull>
  652. <length>4</length>
  653. </field>
  654. <!-- Constant OCP\Share::SHARE_TYPE_* -->
  655. <field>
  656. <name>share_type</name>
  657. <type>integer</type>
  658. <default>0</default>
  659. <notnull>true</notnull>
  660. <length>1</length>
  661. </field>
  662. <!-- Foreign Key users::uid or NULL -->
  663. <field>
  664. <name>share_with</name>
  665. <type>text</type>
  666. <default></default>
  667. <notnull>false</notnull>
  668. <length>255</length>
  669. </field>
  670. <!-- Foreign Key users::uid -->
  671. <!-- This is the owner of the share
  672. which does not have to be the initiator of the share -->
  673. <field>
  674. <name>uid_owner</name>
  675. <type>text</type>
  676. <default></default>
  677. <notnull>true</notnull>
  678. <length>64</length>
  679. </field>
  680. <!-- Foreign Key users::uid -->
  681. <!-- This is the initiator of the share -->
  682. <field>
  683. <name>uid_initiator</name>
  684. <type>text</type>
  685. <default></default>
  686. <notnull>false</notnull>
  687. <length>64</length>
  688. </field>
  689. <!-- Foreign Key share::id or NULL -->
  690. <field>
  691. <name>parent</name>
  692. <type>integer</type>
  693. <notnull>false</notnull>
  694. <length>4</length>
  695. </field>
  696. <!-- E.g. file or folder -->
  697. <field>
  698. <name>item_type</name>
  699. <type>text</type>
  700. <default></default>
  701. <notnull>true</notnull>
  702. <length>64</length>
  703. </field>
  704. <!-- Foreign Key filecache::fileid -->
  705. <field>
  706. <name>item_source</name>
  707. <type>text</type>
  708. <default></default>
  709. <notnull>false</notnull>
  710. <length>255</length>
  711. </field>
  712. <field>
  713. <name>item_target</name>
  714. <type>text</type>
  715. <default></default>
  716. <notnull>false</notnull>
  717. <length>255</length>
  718. </field>
  719. <!-- Foreign Key filecache::fileid -->
  720. <field>
  721. <name>file_source</name>
  722. <type>integer</type>
  723. <notnull>false</notnull>
  724. <length>4</length>
  725. </field>
  726. <field>
  727. <name>file_target</name>
  728. <type>text</type>
  729. <default></default>
  730. <notnull>false</notnull>
  731. <length>512</length>
  732. </field>
  733. <!-- Permission bitfield -->
  734. <field>
  735. <name>permissions</name>
  736. <type>integer</type>
  737. <default>0</default>
  738. <notnull>true</notnull>
  739. <length>1</length>
  740. </field>
  741. <!-- Time of share creation -->
  742. <field>
  743. <name>stime</name>
  744. <type>integer</type>
  745. <default>0</default>
  746. <notnull>true</notnull>
  747. <length>8</length>
  748. </field>
  749. <!-- Whether the receiver accepted the share, if share_with is set. -->
  750. <field>
  751. <name>accepted</name>
  752. <type>integer</type>
  753. <default>0</default>
  754. <notnull>true</notnull>
  755. <length>1</length>
  756. </field>
  757. <!-- Time of share expiration -->
  758. <field>
  759. <name>expiration</name>
  760. <type>timestamp</type>
  761. <default></default>
  762. <notnull>false</notnull>
  763. </field>
  764. <field>
  765. <name>token</name>
  766. <type>text</type>
  767. <default></default>
  768. <notnull>false</notnull>
  769. <length>32</length>
  770. </field>
  771. <field>
  772. <name>mail_send</name>
  773. <type>integer</type>
  774. <default>0</default>
  775. <notnull>true</notnull>
  776. <length>1</length>
  777. </field>
  778. <index>
  779. <name>item_share_type_index</name>
  780. <field>
  781. <name>item_type</name>
  782. <sorting>ascending</sorting>
  783. </field>
  784. <field>
  785. <name>share_type</name>
  786. <sorting>ascending</sorting>
  787. </field>
  788. </index>
  789. <index>
  790. <name>file_source_index</name>
  791. <field>
  792. <name>file_source</name>
  793. <sorting>ascending</sorting>
  794. </field>
  795. </index>
  796. <index>
  797. <name>token_index</name>
  798. <field>
  799. <name>token</name>
  800. <sorting>ascending</sorting>
  801. </field>
  802. </index>
  803. </declaration>
  804. </table>
  805. <table>
  806. <!--
  807. Scheduled background jobs.
  808. See OC\BackgroundJob\JobList.
  809. -->
  810. <name>*dbprefix*jobs</name>
  811. <declaration>
  812. <field>
  813. <name>id</name>
  814. <type>integer</type>
  815. <default>0</default>
  816. <notnull>true</notnull>
  817. <autoincrement>1</autoincrement>
  818. <unsigned>true</unsigned>
  819. <length>4</length>
  820. </field>
  821. <field>
  822. <name>class</name>
  823. <type>text</type>
  824. <default></default>
  825. <notnull>true</notnull>
  826. <length>255</length>
  827. </field>
  828. <field>
  829. <name>argument</name>
  830. <type>text</type>
  831. <default></default>
  832. <notnull>true</notnull>
  833. <length>4000</length>
  834. </field>
  835. <field>
  836. <!-- timestamp when the job was executed the last time -->
  837. <name>last_run</name>
  838. <type>integer</type>
  839. <default></default>
  840. <notnull>false</notnull>
  841. </field>
  842. <field>
  843. <!-- timestamp when the job was checked if it needs execution the last time -->
  844. <name>last_checked</name>
  845. <type>integer</type>
  846. <default></default>
  847. <notnull>false</notnull>
  848. </field>
  849. <field>
  850. <!-- timestamp when the job was reserved the last time, 1 day timeout -->
  851. <name>reserved_at</name>
  852. <type>integer</type>
  853. <default></default>
  854. <notnull>false</notnull>
  855. </field>
  856. <index>
  857. <name>job_class_index</name>
  858. <field>
  859. <name>class</name>
  860. <sorting>ascending</sorting>
  861. </field>
  862. </index>
  863. </declaration>
  864. </table>
  865. <table>
  866. <!--
  867. List of usernames, their display name and login password.
  868. -->
  869. <name>*dbprefix*users</name>
  870. <declaration>
  871. <field>
  872. <name>uid</name>
  873. <type>text</type>
  874. <default></default>
  875. <notnull>true</notnull>
  876. <length>64</length>
  877. </field>
  878. <field>
  879. <name>displayname</name>
  880. <type>text</type>
  881. <default></default>
  882. <length>64</length>
  883. </field>
  884. <field>
  885. <name>password</name>
  886. <type>text</type>
  887. <default></default>
  888. <notnull>true</notnull>
  889. <length>255</length>
  890. </field>
  891. <index>
  892. <name>users_pKey</name>
  893. <primary>true</primary>
  894. <field>
  895. <name>uid</name>
  896. <sorting>ascending</sorting>
  897. </field>
  898. </index>
  899. </declaration>
  900. </table>
  901. <table>
  902. <name>*dbprefix*authtoken</name>
  903. <declaration>
  904. <field>
  905. <name>id</name>
  906. <type>integer</type>
  907. <default>0</default>
  908. <notnull>true</notnull>
  909. <autoincrement>1</autoincrement>
  910. <unsigned>true</unsigned>
  911. <length>4</length>
  912. </field>
  913. <!-- Foreign Key users::uid -->
  914. <field>
  915. <name>uid</name>
  916. <type>text</type>
  917. <default></default>
  918. <notnull>true</notnull>
  919. <length>64</length>
  920. </field>
  921. <field>
  922. <name>login_name</name>
  923. <type>text</type>
  924. <default></default>
  925. <notnull>true</notnull>
  926. <length>64</length>
  927. </field>
  928. <field>
  929. <name>password</name>
  930. <type>clob</type>
  931. <default></default>
  932. <notnull>false</notnull>
  933. </field>
  934. <field>
  935. <name>name</name>
  936. <type>clob</type>
  937. <default></default>
  938. <notnull>true</notnull>
  939. </field>
  940. <field>
  941. <name>token</name>
  942. <type>text</type>
  943. <default></default>
  944. <notnull>true</notnull>
  945. <length>200</length>
  946. </field>
  947. <field>
  948. <name>type</name>
  949. <type>integer</type>
  950. <default>0</default>
  951. <notnull>true</notnull>
  952. <unsigned>true</unsigned>
  953. <length>2</length>
  954. </field>
  955. <field>
  956. <name>remember</name>
  957. <type>integer</type>
  958. <default>0</default>
  959. <notnull>true</notnull>
  960. <unsigned>true</unsigned>
  961. <length>1</length>
  962. </field>
  963. <field>
  964. <name>last_activity</name>
  965. <type>integer</type>
  966. <default>0</default>
  967. <notnull>true</notnull>
  968. <unsigned>true</unsigned>
  969. <length>4</length>
  970. </field>
  971. <field>
  972. <name>last_check</name>
  973. <type>integer</type>
  974. <default>0</default>
  975. <notnull>true</notnull>
  976. <unsigned>true</unsigned>
  977. <length>4</length>
  978. </field>
  979. <index>
  980. <name>authtoken_token_index</name>
  981. <unique>true</unique>
  982. <field>
  983. <name>token</name>
  984. <sorting>ascending</sorting>
  985. </field>
  986. </index>
  987. <index>
  988. <name>authtoken_last_activity_index</name>
  989. <field>
  990. <name>last_activity</name>
  991. <sorting>ascending</sorting>
  992. </field>
  993. </index>
  994. </declaration>
  995. </table>
  996. <table>
  997. <!--
  998. List of usernames, their display name and login password.
  999. -->
  1000. <name>*dbprefix*bruteforce_attempts</name>
  1001. <declaration>
  1002. <field>
  1003. <name>id</name>
  1004. <type>integer</type>
  1005. <default>0</default>
  1006. <notnull>true</notnull>
  1007. <autoincrement>1</autoincrement>
  1008. <unsigned>true</unsigned>
  1009. <length>4</length>
  1010. </field>
  1011. <field>
  1012. <name>action</name>
  1013. <type>text</type>
  1014. <default></default>
  1015. <notnull>true</notnull>
  1016. <length>64</length>
  1017. </field>
  1018. <field>
  1019. <name>occurred</name>
  1020. <type>integer</type>
  1021. <default>0</default>
  1022. <notnull>true</notnull>
  1023. <unsigned>true</unsigned>
  1024. <length>4</length>
  1025. </field>
  1026. <field>
  1027. <name>ip</name>
  1028. <type>text</type>
  1029. <default></default>
  1030. <notnull>true</notnull>
  1031. <length>255</length>
  1032. </field>
  1033. <field>
  1034. <name>subnet</name>
  1035. <type>text</type>
  1036. <default></default>
  1037. <notnull>true</notnull>
  1038. <length>255</length>
  1039. </field>
  1040. <field>
  1041. <name>metadata</name>
  1042. <type>text</type>
  1043. <default></default>
  1044. <notnull>true</notnull>
  1045. <length>255</length>
  1046. </field>
  1047. <index>
  1048. <name>bruteforce_attempts_ip</name>
  1049. <field>
  1050. <name>ip</name>
  1051. <sorting>ascending</sorting>
  1052. </field>
  1053. </index>
  1054. <index>
  1055. <name>bruteforce_attempts_subnet</name>
  1056. <field>
  1057. <name>subnet</name>
  1058. <sorting>ascending</sorting>
  1059. </field>
  1060. </index>
  1061. </declaration>
  1062. </table>
  1063. <table>
  1064. <!--
  1065. List of tags (category) + a unique tag id (id) per user (uid) and type.
  1066. -->
  1067. <name>*dbprefix*vcategory</name>
  1068. <declaration>
  1069. <field>
  1070. <name>id</name>
  1071. <type>integer</type>
  1072. <default>0</default>
  1073. <notnull>true</notnull>
  1074. <autoincrement>1</autoincrement>
  1075. <unsigned>true</unsigned>
  1076. <length>4</length>
  1077. </field>
  1078. <!-- Foreign Key users::uid -->
  1079. <field>
  1080. <name>uid</name>
  1081. <type>text</type>
  1082. <default></default>
  1083. <notnull>true</notnull>
  1084. <length>64</length>
  1085. </field>
  1086. <field>
  1087. <name>type</name>
  1088. <type>text</type>
  1089. <default></default>
  1090. <notnull>true</notnull>
  1091. <length>64</length>
  1092. </field>
  1093. <field>
  1094. <name>category</name>
  1095. <type>text</type>
  1096. <default></default>
  1097. <notnull>true</notnull>
  1098. <length>255</length>
  1099. </field>
  1100. <index>
  1101. <name>uid_index</name>
  1102. <field>
  1103. <name>uid</name>
  1104. <sorting>ascending</sorting>
  1105. </field>
  1106. </index>
  1107. <index>
  1108. <name>type_index</name>
  1109. <field>
  1110. <name>type</name>
  1111. <sorting>ascending</sorting>
  1112. </field>
  1113. </index>
  1114. <index>
  1115. <name>category_index</name>
  1116. <field>
  1117. <name>category</name>
  1118. <sorting>ascending</sorting>
  1119. </field>
  1120. </index>
  1121. </declaration>
  1122. </table>
  1123. <table>
  1124. <!--
  1125. Object-Tag associations per tag type.
  1126. -->
  1127. <name>*dbprefix*vcategory_to_object</name>
  1128. <declaration>
  1129. <field>
  1130. <name>objid</name>
  1131. <type>integer</type>
  1132. <default>0</default>
  1133. <notnull>true</notnull>
  1134. <unsigned>true</unsigned>
  1135. <length>4</length>
  1136. </field>
  1137. <!-- Foreign Key vcategory::id -->
  1138. <field>
  1139. <name>categoryid</name>
  1140. <type>integer</type>
  1141. <default>0</default>
  1142. <notnull>true</notnull>
  1143. <unsigned>true</unsigned>
  1144. <length>4</length>
  1145. </field>
  1146. <field>
  1147. <name>type</name>
  1148. <type>text</type>
  1149. <default></default>
  1150. <notnull>true</notnull>
  1151. <length>64</length>
  1152. </field>
  1153. <index>
  1154. <primary>true</primary>
  1155. <unique>true</unique>
  1156. <name>category_object_index</name>
  1157. <field>
  1158. <name>categoryid</name>
  1159. <sorting>ascending</sorting>
  1160. </field>
  1161. <field>
  1162. <name>objid</name>
  1163. <sorting>ascending</sorting>
  1164. </field>
  1165. <field>
  1166. <name>type</name>
  1167. <sorting>ascending</sorting>
  1168. </field>
  1169. </index>
  1170. <index>
  1171. <name>vcategory_objectd_index</name>
  1172. <field>
  1173. <name>objid</name>
  1174. <sorting>ascending</sorting>
  1175. </field>
  1176. <field>
  1177. <name>type</name>
  1178. <sorting>ascending</sorting>
  1179. </field>
  1180. </index>
  1181. </declaration>
  1182. </table>
  1183. <table>
  1184. <!--
  1185. List of system-wide tags
  1186. -->
  1187. <name>*dbprefix*systemtag</name>
  1188. <declaration>
  1189. <field>
  1190. <name>id</name>
  1191. <type>integer</type>
  1192. <default>0</default>
  1193. <notnull>true</notnull>
  1194. <autoincrement>1</autoincrement>
  1195. <unsigned>true</unsigned>
  1196. <length>4</length>
  1197. </field>
  1198. <!-- Tag name -->
  1199. <field>
  1200. <name>name</name>
  1201. <type>text</type>
  1202. <default></default>
  1203. <notnull>true</notnull>
  1204. <length>64</length>
  1205. </field>
  1206. <!-- Visibility: 0 user-not-visible, 1 user-visible -->
  1207. <field>
  1208. <name>visibility</name>
  1209. <type>integer</type>
  1210. <default>1</default>
  1211. <notnull>true</notnull>
  1212. <length>1</length>
  1213. </field>
  1214. <!-- Editable: 0 user-not-editable, 1 user-editable -->
  1215. <field>
  1216. <name>editable</name>
  1217. <type>integer</type>
  1218. <default>1</default>
  1219. <notnull>true</notnull>
  1220. <length>1</length>
  1221. </field>
  1222. <index>
  1223. <name>tag_ident</name>
  1224. <unique>true</unique>
  1225. <field>
  1226. <name>name</name>
  1227. <sorting>ascending</sorting>
  1228. </field>
  1229. <field>
  1230. <name>visibility</name>
  1231. <sorting>ascending</sorting>
  1232. </field>
  1233. <field>
  1234. <name>editable</name>
  1235. <sorting>ascending</sorting>
  1236. </field>
  1237. </index>
  1238. </declaration>
  1239. </table>
  1240. <table>
  1241. <!--
  1242. System tag to object associations per object type.
  1243. -->
  1244. <name>*dbprefix*systemtag_object_mapping</name>
  1245. <declaration>
  1246. <!-- object id (ex: file id for files)-->
  1247. <field>
  1248. <name>objectid</name>
  1249. <type>text</type>
  1250. <default></default>
  1251. <notnull>true</notnull>
  1252. <length>64</length>
  1253. </field>
  1254. <!-- object type (ex: "files")-->
  1255. <field>
  1256. <name>objecttype</name>
  1257. <type>text</type>
  1258. <default></default>
  1259. <notnull>true</notnull>
  1260. <length>64</length>
  1261. </field>
  1262. <!-- Foreign Key systemtag::id -->
  1263. <field>
  1264. <name>systemtagid</name>
  1265. <type>integer</type>
  1266. <default>0</default>
  1267. <notnull>true</notnull>
  1268. <unsigned>true</unsigned>
  1269. <length>4</length>
  1270. </field>
  1271. <index>
  1272. <unique>true</unique>
  1273. <name>mapping</name>
  1274. <field>
  1275. <name>objecttype</name>
  1276. <sorting>ascending</sorting>
  1277. </field>
  1278. <field>
  1279. <name>objectid</name>
  1280. <sorting>ascending</sorting>
  1281. </field>
  1282. <field>
  1283. <name>systemtagid</name>
  1284. <sorting>ascending</sorting>
  1285. </field>
  1286. </index>
  1287. </declaration>
  1288. </table>
  1289. <table>
  1290. <!--
  1291. System tag to group mapping
  1292. -->
  1293. <name>*dbprefix*systemtag_group</name>
  1294. <declaration>
  1295. <!-- Foreign Key systemtag::id -->
  1296. <field>
  1297. <name>systemtagid</name>
  1298. <type>integer</type>
  1299. <default>0</default>
  1300. <notnull>true</notnull>
  1301. <unsigned>true</unsigned>
  1302. <length>4</length>
  1303. </field>
  1304. <field>
  1305. <name>gid</name>
  1306. <type>string</type>
  1307. <notnull>true</notnull>
  1308. </field>
  1309. <index>
  1310. <name>systemtag_group</name>
  1311. <primary>true</primary>
  1312. <unique>true</unique>
  1313. <field>
  1314. <name>gid</name>
  1315. <sorting>ascending</sorting>
  1316. </field>
  1317. <field>
  1318. <name>systemtagid</name>
  1319. <sorting>ascending</sorting>
  1320. </field>
  1321. </index>
  1322. </declaration>
  1323. </table>
  1324. <table>
  1325. <!--
  1326. Namespaced Key-Value Store for arbitrary data.
  1327. - Keys are namespaced per userid and appid.
  1328. - E.g. (admin, files, foo) -> bar
  1329. -->
  1330. <name>*dbprefix*privatedata</name>
  1331. <declaration>
  1332. <field>
  1333. <name>keyid</name>
  1334. <type>integer</type>
  1335. <default>0</default>
  1336. <notnull>true</notnull>
  1337. <unsigned>true</unsigned>
  1338. <length>4</length>
  1339. <autoincrement>1</autoincrement>
  1340. </field>
  1341. <!-- Foreign Key users::uid -->
  1342. <field>
  1343. <name>user</name>
  1344. <type>text</type>
  1345. <default></default>
  1346. <notnull>true</notnull>
  1347. <length>64</length>
  1348. </field>
  1349. <field>
  1350. <name>app</name>
  1351. <type>text</type>
  1352. <default></default>
  1353. <notnull>true</notnull>
  1354. <length>255</length>
  1355. </field>
  1356. <field>
  1357. <name>key</name>
  1358. <type>text</type>
  1359. <default></default>
  1360. <notnull>true</notnull>
  1361. <length>255</length>
  1362. </field>
  1363. <field>
  1364. <name>value</name>
  1365. <type>text</type>
  1366. <default></default>
  1367. <notnull>true</notnull>
  1368. <length>255</length>
  1369. </field>
  1370. <index>
  1371. <primary>true</primary>
  1372. <unique>true</unique>
  1373. <name>keyid_index</name>
  1374. <field>
  1375. <name>keyid</name>
  1376. <sorting>ascending</sorting>
  1377. </field>
  1378. </index>
  1379. </declaration>
  1380. </table>
  1381. <table>
  1382. <!--
  1383. Table for storing transactional file locking
  1384. -->
  1385. <name>*dbprefix*file_locks</name>
  1386. <declaration>
  1387. <field>
  1388. <name>id</name>
  1389. <type>integer</type>
  1390. <default>0</default>
  1391. <notnull>true</notnull>
  1392. <unsigned>true</unsigned>
  1393. <length>4</length>
  1394. <autoincrement>1</autoincrement>
  1395. </field>
  1396. <field>
  1397. <name>lock</name>
  1398. <type>integer</type>
  1399. <default>0</default>
  1400. <notnull>true</notnull>
  1401. <length>4</length>
  1402. </field>
  1403. <field>
  1404. <name>key</name>
  1405. <type>text</type>
  1406. <notnull>true</notnull>
  1407. <length>64</length>
  1408. </field>
  1409. <field>
  1410. <name>ttl</name>
  1411. <type>integer</type>
  1412. <default>-1</default>
  1413. <notnull>true</notnull>
  1414. <length>4</length>
  1415. </field>
  1416. <index>
  1417. <primary>true</primary>
  1418. <unique>true</unique>
  1419. <name>lock_id_index</name>
  1420. <field>
  1421. <name>id</name>
  1422. <sorting>ascending</sorting>
  1423. </field>
  1424. </index>
  1425. <index>
  1426. <unique>true</unique>
  1427. <name>lock_key_index</name>
  1428. <field>
  1429. <name>key</name>
  1430. <sorting>ascending</sorting>
  1431. </field>
  1432. </index>
  1433. <index>
  1434. <name>lock_ttl_index</name>
  1435. <field>
  1436. <name>ttl</name>
  1437. <sorting>ascending</sorting>
  1438. </field>
  1439. </index>
  1440. </declaration>
  1441. </table>
  1442. <table>
  1443. <!--
  1444. default place to store comment data
  1445. -->
  1446. <name>*dbprefix*comments</name>
  1447. <declaration>
  1448. <field>
  1449. <name>id</name>
  1450. <type>integer</type>
  1451. <default>0</default>
  1452. <notnull>true</notnull>
  1453. <unsigned>true</unsigned>
  1454. <length>4</length>
  1455. <autoincrement>1</autoincrement>
  1456. </field>
  1457. <field>
  1458. <name>parent_id</name>
  1459. <type>integer</type>
  1460. <default>0</default>
  1461. <notnull>true</notnull>
  1462. <unsigned>true</unsigned>
  1463. <length>4</length>
  1464. </field>
  1465. <field>
  1466. <name>topmost_parent_id</name>
  1467. <type>integer</type>
  1468. <default>0</default>
  1469. <notnull>true</notnull>
  1470. <unsigned>true</unsigned>
  1471. <length>4</length>
  1472. </field>
  1473. <field>
  1474. <name>children_count</name>
  1475. <type>integer</type>
  1476. <default>0</default>
  1477. <notnull>true</notnull>
  1478. <unsigned>true</unsigned>
  1479. <length>4</length>
  1480. </field>
  1481. <field>
  1482. <name>actor_type</name>
  1483. <type>text</type>
  1484. <default></default>
  1485. <notnull>true</notnull>
  1486. <length>64</length>
  1487. </field>
  1488. <field>
  1489. <name>actor_id</name>
  1490. <type>text</type>
  1491. <default></default>
  1492. <notnull>true</notnull>
  1493. <length>64</length>
  1494. </field>
  1495. <field>
  1496. <name>message</name>
  1497. <type>clob</type>
  1498. <default></default>
  1499. <notnull>false</notnull>
  1500. </field>
  1501. <field>
  1502. <name>verb</name>
  1503. <type>text</type>
  1504. <default></default>
  1505. <notnull>false</notnull>
  1506. <length>64</length>
  1507. </field>
  1508. <field>
  1509. <name>creation_timestamp</name>
  1510. <type>timestamp</type>
  1511. <default></default>
  1512. <notnull>false</notnull>
  1513. </field>
  1514. <field>
  1515. <name>latest_child_timestamp</name>
  1516. <type>timestamp</type>
  1517. <default></default>
  1518. <notnull>false</notnull>
  1519. </field>
  1520. <field>
  1521. <name>object_type</name>
  1522. <type>text</type>
  1523. <default></default>
  1524. <notnull>true</notnull>
  1525. <length>64</length>
  1526. </field>
  1527. <field>
  1528. <name>object_id</name>
  1529. <type>text</type>
  1530. <default></default>
  1531. <notnull>true</notnull>
  1532. <length>64</length>
  1533. </field>
  1534. <index>
  1535. <name>comments_parent_id_index</name>
  1536. <unique>false</unique>
  1537. <field>
  1538. <name>parent_id</name>
  1539. <sorting>descending</sorting>
  1540. </field>
  1541. </index>
  1542. <index>
  1543. <name>comments_topmost_parent_id_idx</name>
  1544. <unique>false</unique>
  1545. <field>
  1546. <name>topmost_parent_id</name>
  1547. <sorting>descending</sorting>
  1548. </field>
  1549. </index>
  1550. <index>
  1551. <name>comments_object_index</name>
  1552. <unique>false</unique>
  1553. <field>
  1554. <name>object_type</name>
  1555. <sorting>ascending</sorting>
  1556. </field>
  1557. <field>
  1558. <name>object_id</name>
  1559. <sorting>ascending</sorting>
  1560. </field>
  1561. <field>
  1562. <name>creation_timestamp</name>
  1563. <sorting>descending</sorting>
  1564. </field>
  1565. </index>
  1566. <index>
  1567. <name>comments_actor_index</name>
  1568. <unique>false</unique>
  1569. <field>
  1570. <name>actor_type</name>
  1571. <sorting>ascending</sorting>
  1572. </field>
  1573. <field>
  1574. <name>actor_id</name>
  1575. <sorting>ascending</sorting>
  1576. </field>
  1577. </index>
  1578. </declaration>
  1579. </table>
  1580. <table>
  1581. <!--
  1582. default place to store per user and object read markers
  1583. -->
  1584. <name>*dbprefix*comments_read_markers</name>
  1585. <declaration>
  1586. <field>
  1587. <name>user_id</name>
  1588. <type>text</type>
  1589. <default></default>
  1590. <notnull>true</notnull>
  1591. <length>64</length>
  1592. </field>
  1593. <field>
  1594. <name>marker_datetime</name>
  1595. <type>timestamp</type>
  1596. <default></default>
  1597. <notnull>false</notnull>
  1598. </field>
  1599. <field>
  1600. <name>object_type</name>
  1601. <type>text</type>
  1602. <default></default>
  1603. <notnull>true</notnull>
  1604. <length>64</length>
  1605. </field>
  1606. <field>
  1607. <name>object_id</name>
  1608. <type>text</type>
  1609. <default></default>
  1610. <notnull>true</notnull>
  1611. <length>64</length>
  1612. </field>
  1613. <index>
  1614. <name>comments_marker_object_index</name>
  1615. <unique>false</unique>
  1616. <field>
  1617. <name>object_type</name>
  1618. <sorting>ascending</sorting>
  1619. </field>
  1620. <field>
  1621. <name>object_id</name>
  1622. <sorting>ascending</sorting>
  1623. </field>
  1624. </index>
  1625. <index>
  1626. <name>comments_marker_index</name>
  1627. <unique>true</unique>
  1628. <field>
  1629. <name>user_id</name>
  1630. <sorting>descending</sorting>
  1631. </field>
  1632. <field>
  1633. <name>object_type</name>
  1634. <sorting>ascending</sorting>
  1635. </field>
  1636. <field>
  1637. <name>object_id</name>
  1638. <sorting>ascending</sorting>
  1639. </field>
  1640. </index>
  1641. </declaration>
  1642. </table>
  1643. <table>
  1644. <!--
  1645. Encrypted credentials storage
  1646. -->
  1647. <name>*dbprefix*credentials</name>
  1648. <declaration>
  1649. <field>
  1650. <name>user</name>
  1651. <type>text</type>
  1652. <default></default>
  1653. <notnull>false</notnull>
  1654. <length>64</length>
  1655. </field>
  1656. <field>
  1657. <name>identifier</name>
  1658. <type>text</type>
  1659. <notnull>true</notnull>
  1660. <length>64</length>
  1661. </field>
  1662. <field>
  1663. <name>credentials</name>
  1664. <type>clob</type>
  1665. <notnull>false</notnull>
  1666. </field>
  1667. <index>
  1668. <name>credentials_user_id</name>
  1669. <primary>true</primary>
  1670. <unique>true</unique>
  1671. <field>
  1672. <name>user</name>
  1673. <sorting>ascending</sorting>
  1674. </field>
  1675. <field>
  1676. <name>identifier</name>
  1677. <sorting>ascending</sorting>
  1678. </field>
  1679. </index>
  1680. <index>
  1681. <name>credentials_user</name>
  1682. <unique>false</unique>
  1683. <field>
  1684. <name>user</name>
  1685. <sorting>ascending</sorting>
  1686. </field>
  1687. </index>
  1688. </declaration>
  1689. </table>
  1690. <table>
  1691. <!-- Extra admin settings sections -->
  1692. <name>*dbprefix*admin_sections</name>
  1693. <declaration>
  1694. <field>
  1695. <name>id</name>
  1696. <type>text</type>
  1697. <default></default>
  1698. <notnull>false</notnull>
  1699. <length>64</length>
  1700. </field>
  1701. <field>
  1702. <name>class</name>
  1703. <type>text</type>
  1704. <default></default>
  1705. <notnull>true</notnull>
  1706. <length>255</length>
  1707. </field>
  1708. <field>
  1709. <name>priority</name>
  1710. <type>integer</type>
  1711. <default></default>
  1712. <notnull>true</notnull>
  1713. <length>1</length>
  1714. </field>
  1715. <index>
  1716. <name>admin_sections_id_index</name>
  1717. <primary>true</primary>
  1718. <field>
  1719. <name>id</name>
  1720. <sorting>ascending</sorting>
  1721. </field>
  1722. </index>
  1723. <index>
  1724. <name>admin_sections_class</name>
  1725. <unique>true</unique>
  1726. <field>
  1727. <name>class</name>
  1728. <sorting>ascending</sorting>
  1729. </field>
  1730. </index>
  1731. </declaration>
  1732. </table>
  1733. <table>
  1734. <!-- Extra admin settings -->
  1735. <name>*dbprefix*admin_settings</name>
  1736. <declaration>
  1737. <field>
  1738. <name>id</name>
  1739. <type>integer</type>
  1740. <default>0</default>
  1741. <notnull>true</notnull>
  1742. <autoincrement>1</autoincrement>
  1743. <length>4</length>
  1744. </field>
  1745. <field>
  1746. <name>class</name>
  1747. <type>text</type>
  1748. <default></default>
  1749. <notnull>true</notnull>
  1750. <length>255</length>
  1751. </field>
  1752. <!-- id of the section, foreign key: admin_sections.id -->
  1753. <field>
  1754. <name>section</name>
  1755. <type>text</type>
  1756. <default></default>
  1757. <notnull>false</notnull>
  1758. <length>64</length>
  1759. </field>
  1760. <field>
  1761. <name>priority</name>
  1762. <type>integer</type>
  1763. <default></default>
  1764. <notnull>true</notnull>
  1765. <length>1</length>
  1766. </field>
  1767. <index>
  1768. <name>admin_settings_id_index</name>
  1769. <primary>true</primary>
  1770. <field>
  1771. <name>id</name>
  1772. <sorting>ascending</sorting>
  1773. </field>
  1774. </index>
  1775. <index>
  1776. <name>admin_settings_class</name>
  1777. <unique>true</unique>
  1778. <field>
  1779. <name>class</name>
  1780. <sorting>ascending</sorting>
  1781. </field>
  1782. </index>
  1783. <index>
  1784. <name>admin_settings_section</name>
  1785. <unique>false</unique>
  1786. <field>
  1787. <name>section</name>
  1788. <sorting>ascending</sorting>
  1789. </field>
  1790. </index>
  1791. </declaration>
  1792. </table>
  1793. </database>