db_structure.xml 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149
  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. <field>
  980. <name>scope</name>
  981. <type>clob</type>
  982. <default></default>
  983. <notnull>false</notnull>
  984. </field>
  985. <index>
  986. <name>authtoken_token_index</name>
  987. <unique>true</unique>
  988. <field>
  989. <name>token</name>
  990. <sorting>ascending</sorting>
  991. </field>
  992. </index>
  993. <index>
  994. <name>authtoken_last_activity_index</name>
  995. <field>
  996. <name>last_activity</name>
  997. <sorting>ascending</sorting>
  998. </field>
  999. </index>
  1000. </declaration>
  1001. </table>
  1002. <table>
  1003. <!--
  1004. List of usernames, their display name and login password.
  1005. -->
  1006. <name>*dbprefix*bruteforce_attempts</name>
  1007. <declaration>
  1008. <field>
  1009. <name>id</name>
  1010. <type>integer</type>
  1011. <default>0</default>
  1012. <notnull>true</notnull>
  1013. <autoincrement>1</autoincrement>
  1014. <unsigned>true</unsigned>
  1015. <length>4</length>
  1016. </field>
  1017. <field>
  1018. <name>action</name>
  1019. <type>text</type>
  1020. <default></default>
  1021. <notnull>true</notnull>
  1022. <length>64</length>
  1023. </field>
  1024. <field>
  1025. <name>occurred</name>
  1026. <type>integer</type>
  1027. <default>0</default>
  1028. <notnull>true</notnull>
  1029. <unsigned>true</unsigned>
  1030. <length>4</length>
  1031. </field>
  1032. <field>
  1033. <name>ip</name>
  1034. <type>text</type>
  1035. <default></default>
  1036. <notnull>true</notnull>
  1037. <length>255</length>
  1038. </field>
  1039. <field>
  1040. <name>subnet</name>
  1041. <type>text</type>
  1042. <default></default>
  1043. <notnull>true</notnull>
  1044. <length>255</length>
  1045. </field>
  1046. <field>
  1047. <name>metadata</name>
  1048. <type>text</type>
  1049. <default></default>
  1050. <notnull>true</notnull>
  1051. <length>255</length>
  1052. </field>
  1053. <index>
  1054. <name>bruteforce_attempts_ip</name>
  1055. <field>
  1056. <name>ip</name>
  1057. <sorting>ascending</sorting>
  1058. </field>
  1059. </index>
  1060. <index>
  1061. <name>bruteforce_attempts_subnet</name>
  1062. <field>
  1063. <name>subnet</name>
  1064. <sorting>ascending</sorting>
  1065. </field>
  1066. </index>
  1067. </declaration>
  1068. </table>
  1069. <table>
  1070. <!--
  1071. List of tags (category) + a unique tag id (id) per user (uid) and type.
  1072. -->
  1073. <name>*dbprefix*vcategory</name>
  1074. <declaration>
  1075. <field>
  1076. <name>id</name>
  1077. <type>integer</type>
  1078. <default>0</default>
  1079. <notnull>true</notnull>
  1080. <autoincrement>1</autoincrement>
  1081. <unsigned>true</unsigned>
  1082. <length>4</length>
  1083. </field>
  1084. <!-- Foreign Key users::uid -->
  1085. <field>
  1086. <name>uid</name>
  1087. <type>text</type>
  1088. <default></default>
  1089. <notnull>true</notnull>
  1090. <length>64</length>
  1091. </field>
  1092. <field>
  1093. <name>type</name>
  1094. <type>text</type>
  1095. <default></default>
  1096. <notnull>true</notnull>
  1097. <length>64</length>
  1098. </field>
  1099. <field>
  1100. <name>category</name>
  1101. <type>text</type>
  1102. <default></default>
  1103. <notnull>true</notnull>
  1104. <length>255</length>
  1105. </field>
  1106. <index>
  1107. <name>uid_index</name>
  1108. <field>
  1109. <name>uid</name>
  1110. <sorting>ascending</sorting>
  1111. </field>
  1112. </index>
  1113. <index>
  1114. <name>type_index</name>
  1115. <field>
  1116. <name>type</name>
  1117. <sorting>ascending</sorting>
  1118. </field>
  1119. </index>
  1120. <index>
  1121. <name>category_index</name>
  1122. <field>
  1123. <name>category</name>
  1124. <sorting>ascending</sorting>
  1125. </field>
  1126. </index>
  1127. </declaration>
  1128. </table>
  1129. <table>
  1130. <!--
  1131. Object-Tag associations per tag type.
  1132. -->
  1133. <name>*dbprefix*vcategory_to_object</name>
  1134. <declaration>
  1135. <field>
  1136. <name>objid</name>
  1137. <type>integer</type>
  1138. <default>0</default>
  1139. <notnull>true</notnull>
  1140. <unsigned>true</unsigned>
  1141. <length>4</length>
  1142. </field>
  1143. <!-- Foreign Key vcategory::id -->
  1144. <field>
  1145. <name>categoryid</name>
  1146. <type>integer</type>
  1147. <default>0</default>
  1148. <notnull>true</notnull>
  1149. <unsigned>true</unsigned>
  1150. <length>4</length>
  1151. </field>
  1152. <field>
  1153. <name>type</name>
  1154. <type>text</type>
  1155. <default></default>
  1156. <notnull>true</notnull>
  1157. <length>64</length>
  1158. </field>
  1159. <index>
  1160. <primary>true</primary>
  1161. <unique>true</unique>
  1162. <name>category_object_index</name>
  1163. <field>
  1164. <name>categoryid</name>
  1165. <sorting>ascending</sorting>
  1166. </field>
  1167. <field>
  1168. <name>objid</name>
  1169. <sorting>ascending</sorting>
  1170. </field>
  1171. <field>
  1172. <name>type</name>
  1173. <sorting>ascending</sorting>
  1174. </field>
  1175. </index>
  1176. <index>
  1177. <name>vcategory_objectd_index</name>
  1178. <field>
  1179. <name>objid</name>
  1180. <sorting>ascending</sorting>
  1181. </field>
  1182. <field>
  1183. <name>type</name>
  1184. <sorting>ascending</sorting>
  1185. </field>
  1186. </index>
  1187. </declaration>
  1188. </table>
  1189. <table>
  1190. <!--
  1191. List of system-wide tags
  1192. -->
  1193. <name>*dbprefix*systemtag</name>
  1194. <declaration>
  1195. <field>
  1196. <name>id</name>
  1197. <type>integer</type>
  1198. <default>0</default>
  1199. <notnull>true</notnull>
  1200. <autoincrement>1</autoincrement>
  1201. <unsigned>true</unsigned>
  1202. <length>4</length>
  1203. </field>
  1204. <!-- Tag name -->
  1205. <field>
  1206. <name>name</name>
  1207. <type>text</type>
  1208. <default></default>
  1209. <notnull>true</notnull>
  1210. <length>64</length>
  1211. </field>
  1212. <!-- Visibility: 0 user-not-visible, 1 user-visible -->
  1213. <field>
  1214. <name>visibility</name>
  1215. <type>integer</type>
  1216. <default>1</default>
  1217. <notnull>true</notnull>
  1218. <length>1</length>
  1219. </field>
  1220. <!-- Editable: 0 user-not-editable, 1 user-editable -->
  1221. <field>
  1222. <name>editable</name>
  1223. <type>integer</type>
  1224. <default>1</default>
  1225. <notnull>true</notnull>
  1226. <length>1</length>
  1227. </field>
  1228. <index>
  1229. <name>tag_ident</name>
  1230. <unique>true</unique>
  1231. <field>
  1232. <name>name</name>
  1233. <sorting>ascending</sorting>
  1234. </field>
  1235. <field>
  1236. <name>visibility</name>
  1237. <sorting>ascending</sorting>
  1238. </field>
  1239. <field>
  1240. <name>editable</name>
  1241. <sorting>ascending</sorting>
  1242. </field>
  1243. </index>
  1244. </declaration>
  1245. </table>
  1246. <table>
  1247. <!--
  1248. System tag to object associations per object type.
  1249. -->
  1250. <name>*dbprefix*systemtag_object_mapping</name>
  1251. <declaration>
  1252. <!-- object id (ex: file id for files)-->
  1253. <field>
  1254. <name>objectid</name>
  1255. <type>text</type>
  1256. <default></default>
  1257. <notnull>true</notnull>
  1258. <length>64</length>
  1259. </field>
  1260. <!-- object type (ex: "files")-->
  1261. <field>
  1262. <name>objecttype</name>
  1263. <type>text</type>
  1264. <default></default>
  1265. <notnull>true</notnull>
  1266. <length>64</length>
  1267. </field>
  1268. <!-- Foreign Key systemtag::id -->
  1269. <field>
  1270. <name>systemtagid</name>
  1271. <type>integer</type>
  1272. <default>0</default>
  1273. <notnull>true</notnull>
  1274. <unsigned>true</unsigned>
  1275. <length>4</length>
  1276. </field>
  1277. <index>
  1278. <unique>true</unique>
  1279. <name>mapping</name>
  1280. <field>
  1281. <name>objecttype</name>
  1282. <sorting>ascending</sorting>
  1283. </field>
  1284. <field>
  1285. <name>objectid</name>
  1286. <sorting>ascending</sorting>
  1287. </field>
  1288. <field>
  1289. <name>systemtagid</name>
  1290. <sorting>ascending</sorting>
  1291. </field>
  1292. </index>
  1293. </declaration>
  1294. </table>
  1295. <table>
  1296. <!--
  1297. System tag to group mapping
  1298. -->
  1299. <name>*dbprefix*systemtag_group</name>
  1300. <declaration>
  1301. <!-- Foreign Key systemtag::id -->
  1302. <field>
  1303. <name>systemtagid</name>
  1304. <type>integer</type>
  1305. <default>0</default>
  1306. <notnull>true</notnull>
  1307. <unsigned>true</unsigned>
  1308. <length>4</length>
  1309. </field>
  1310. <field>
  1311. <name>gid</name>
  1312. <type>string</type>
  1313. <notnull>true</notnull>
  1314. </field>
  1315. <index>
  1316. <name>systemtag_group</name>
  1317. <primary>true</primary>
  1318. <unique>true</unique>
  1319. <field>
  1320. <name>gid</name>
  1321. <sorting>ascending</sorting>
  1322. </field>
  1323. <field>
  1324. <name>systemtagid</name>
  1325. <sorting>ascending</sorting>
  1326. </field>
  1327. </index>
  1328. </declaration>
  1329. </table>
  1330. <table>
  1331. <!--
  1332. Namespaced Key-Value Store for arbitrary data.
  1333. - Keys are namespaced per userid and appid.
  1334. - E.g. (admin, files, foo) -> bar
  1335. -->
  1336. <name>*dbprefix*privatedata</name>
  1337. <declaration>
  1338. <field>
  1339. <name>keyid</name>
  1340. <type>integer</type>
  1341. <default>0</default>
  1342. <notnull>true</notnull>
  1343. <unsigned>true</unsigned>
  1344. <length>4</length>
  1345. <autoincrement>1</autoincrement>
  1346. </field>
  1347. <!-- Foreign Key users::uid -->
  1348. <field>
  1349. <name>user</name>
  1350. <type>text</type>
  1351. <default></default>
  1352. <notnull>true</notnull>
  1353. <length>64</length>
  1354. </field>
  1355. <field>
  1356. <name>app</name>
  1357. <type>text</type>
  1358. <default></default>
  1359. <notnull>true</notnull>
  1360. <length>255</length>
  1361. </field>
  1362. <field>
  1363. <name>key</name>
  1364. <type>text</type>
  1365. <default></default>
  1366. <notnull>true</notnull>
  1367. <length>255</length>
  1368. </field>
  1369. <field>
  1370. <name>value</name>
  1371. <type>text</type>
  1372. <default></default>
  1373. <notnull>true</notnull>
  1374. <length>255</length>
  1375. </field>
  1376. <index>
  1377. <primary>true</primary>
  1378. <unique>true</unique>
  1379. <name>keyid_index</name>
  1380. <field>
  1381. <name>keyid</name>
  1382. <sorting>ascending</sorting>
  1383. </field>
  1384. </index>
  1385. </declaration>
  1386. </table>
  1387. <table>
  1388. <!--
  1389. Table for storing transactional file locking
  1390. -->
  1391. <name>*dbprefix*file_locks</name>
  1392. <declaration>
  1393. <field>
  1394. <name>id</name>
  1395. <type>integer</type>
  1396. <default>0</default>
  1397. <notnull>true</notnull>
  1398. <unsigned>true</unsigned>
  1399. <length>4</length>
  1400. <autoincrement>1</autoincrement>
  1401. </field>
  1402. <field>
  1403. <name>lock</name>
  1404. <type>integer</type>
  1405. <default>0</default>
  1406. <notnull>true</notnull>
  1407. <length>4</length>
  1408. </field>
  1409. <field>
  1410. <name>key</name>
  1411. <type>text</type>
  1412. <notnull>true</notnull>
  1413. <length>64</length>
  1414. </field>
  1415. <field>
  1416. <name>ttl</name>
  1417. <type>integer</type>
  1418. <default>-1</default>
  1419. <notnull>true</notnull>
  1420. <length>4</length>
  1421. </field>
  1422. <index>
  1423. <primary>true</primary>
  1424. <unique>true</unique>
  1425. <name>lock_id_index</name>
  1426. <field>
  1427. <name>id</name>
  1428. <sorting>ascending</sorting>
  1429. </field>
  1430. </index>
  1431. <index>
  1432. <unique>true</unique>
  1433. <name>lock_key_index</name>
  1434. <field>
  1435. <name>key</name>
  1436. <sorting>ascending</sorting>
  1437. </field>
  1438. </index>
  1439. <index>
  1440. <name>lock_ttl_index</name>
  1441. <field>
  1442. <name>ttl</name>
  1443. <sorting>ascending</sorting>
  1444. </field>
  1445. </index>
  1446. </declaration>
  1447. </table>
  1448. <table>
  1449. <!--
  1450. default place to store comment data
  1451. -->
  1452. <name>*dbprefix*comments</name>
  1453. <declaration>
  1454. <field>
  1455. <name>id</name>
  1456. <type>integer</type>
  1457. <default>0</default>
  1458. <notnull>true</notnull>
  1459. <unsigned>true</unsigned>
  1460. <length>4</length>
  1461. <autoincrement>1</autoincrement>
  1462. </field>
  1463. <field>
  1464. <name>parent_id</name>
  1465. <type>integer</type>
  1466. <default>0</default>
  1467. <notnull>true</notnull>
  1468. <unsigned>true</unsigned>
  1469. <length>4</length>
  1470. </field>
  1471. <field>
  1472. <name>topmost_parent_id</name>
  1473. <type>integer</type>
  1474. <default>0</default>
  1475. <notnull>true</notnull>
  1476. <unsigned>true</unsigned>
  1477. <length>4</length>
  1478. </field>
  1479. <field>
  1480. <name>children_count</name>
  1481. <type>integer</type>
  1482. <default>0</default>
  1483. <notnull>true</notnull>
  1484. <unsigned>true</unsigned>
  1485. <length>4</length>
  1486. </field>
  1487. <field>
  1488. <name>actor_type</name>
  1489. <type>text</type>
  1490. <default></default>
  1491. <notnull>true</notnull>
  1492. <length>64</length>
  1493. </field>
  1494. <field>
  1495. <name>actor_id</name>
  1496. <type>text</type>
  1497. <default></default>
  1498. <notnull>true</notnull>
  1499. <length>64</length>
  1500. </field>
  1501. <field>
  1502. <name>message</name>
  1503. <type>clob</type>
  1504. <default></default>
  1505. <notnull>false</notnull>
  1506. </field>
  1507. <field>
  1508. <name>verb</name>
  1509. <type>text</type>
  1510. <default></default>
  1511. <notnull>false</notnull>
  1512. <length>64</length>
  1513. </field>
  1514. <field>
  1515. <name>creation_timestamp</name>
  1516. <type>timestamp</type>
  1517. <default></default>
  1518. <notnull>false</notnull>
  1519. </field>
  1520. <field>
  1521. <name>latest_child_timestamp</name>
  1522. <type>timestamp</type>
  1523. <default></default>
  1524. <notnull>false</notnull>
  1525. </field>
  1526. <field>
  1527. <name>object_type</name>
  1528. <type>text</type>
  1529. <default></default>
  1530. <notnull>true</notnull>
  1531. <length>64</length>
  1532. </field>
  1533. <field>
  1534. <name>object_id</name>
  1535. <type>text</type>
  1536. <default></default>
  1537. <notnull>true</notnull>
  1538. <length>64</length>
  1539. </field>
  1540. <index>
  1541. <name>comments_parent_id_index</name>
  1542. <unique>false</unique>
  1543. <field>
  1544. <name>parent_id</name>
  1545. <sorting>descending</sorting>
  1546. </field>
  1547. </index>
  1548. <index>
  1549. <name>comments_topmost_parent_id_idx</name>
  1550. <unique>false</unique>
  1551. <field>
  1552. <name>topmost_parent_id</name>
  1553. <sorting>descending</sorting>
  1554. </field>
  1555. </index>
  1556. <index>
  1557. <name>comments_object_index</name>
  1558. <unique>false</unique>
  1559. <field>
  1560. <name>object_type</name>
  1561. <sorting>ascending</sorting>
  1562. </field>
  1563. <field>
  1564. <name>object_id</name>
  1565. <sorting>ascending</sorting>
  1566. </field>
  1567. <field>
  1568. <name>creation_timestamp</name>
  1569. <sorting>descending</sorting>
  1570. </field>
  1571. </index>
  1572. <index>
  1573. <name>comments_actor_index</name>
  1574. <unique>false</unique>
  1575. <field>
  1576. <name>actor_type</name>
  1577. <sorting>ascending</sorting>
  1578. </field>
  1579. <field>
  1580. <name>actor_id</name>
  1581. <sorting>ascending</sorting>
  1582. </field>
  1583. </index>
  1584. </declaration>
  1585. </table>
  1586. <table>
  1587. <!--
  1588. default place to store per user and object read markers
  1589. -->
  1590. <name>*dbprefix*comments_read_markers</name>
  1591. <declaration>
  1592. <field>
  1593. <name>user_id</name>
  1594. <type>text</type>
  1595. <default></default>
  1596. <notnull>true</notnull>
  1597. <length>64</length>
  1598. </field>
  1599. <field>
  1600. <name>marker_datetime</name>
  1601. <type>timestamp</type>
  1602. <default></default>
  1603. <notnull>false</notnull>
  1604. </field>
  1605. <field>
  1606. <name>object_type</name>
  1607. <type>text</type>
  1608. <default></default>
  1609. <notnull>true</notnull>
  1610. <length>64</length>
  1611. </field>
  1612. <field>
  1613. <name>object_id</name>
  1614. <type>text</type>
  1615. <default></default>
  1616. <notnull>true</notnull>
  1617. <length>64</length>
  1618. </field>
  1619. <index>
  1620. <name>comments_marker_object_index</name>
  1621. <unique>false</unique>
  1622. <field>
  1623. <name>object_type</name>
  1624. <sorting>ascending</sorting>
  1625. </field>
  1626. <field>
  1627. <name>object_id</name>
  1628. <sorting>ascending</sorting>
  1629. </field>
  1630. </index>
  1631. <index>
  1632. <name>comments_marker_index</name>
  1633. <unique>true</unique>
  1634. <field>
  1635. <name>user_id</name>
  1636. <sorting>descending</sorting>
  1637. </field>
  1638. <field>
  1639. <name>object_type</name>
  1640. <sorting>ascending</sorting>
  1641. </field>
  1642. <field>
  1643. <name>object_id</name>
  1644. <sorting>ascending</sorting>
  1645. </field>
  1646. </index>
  1647. </declaration>
  1648. </table>
  1649. <table>
  1650. <!--
  1651. Encrypted credentials storage
  1652. -->
  1653. <name>*dbprefix*credentials</name>
  1654. <declaration>
  1655. <field>
  1656. <name>user</name>
  1657. <type>text</type>
  1658. <default></default>
  1659. <notnull>false</notnull>
  1660. <length>64</length>
  1661. </field>
  1662. <field>
  1663. <name>identifier</name>
  1664. <type>text</type>
  1665. <notnull>true</notnull>
  1666. <length>64</length>
  1667. </field>
  1668. <field>
  1669. <name>credentials</name>
  1670. <type>clob</type>
  1671. <notnull>false</notnull>
  1672. </field>
  1673. <index>
  1674. <name>credentials_user_id</name>
  1675. <primary>true</primary>
  1676. <unique>true</unique>
  1677. <field>
  1678. <name>user</name>
  1679. <sorting>ascending</sorting>
  1680. </field>
  1681. <field>
  1682. <name>identifier</name>
  1683. <sorting>ascending</sorting>
  1684. </field>
  1685. </index>
  1686. <index>
  1687. <name>credentials_user</name>
  1688. <unique>false</unique>
  1689. <field>
  1690. <name>user</name>
  1691. <sorting>ascending</sorting>
  1692. </field>
  1693. </index>
  1694. </declaration>
  1695. </table>
  1696. <table>
  1697. <!-- Extra admin settings sections -->
  1698. <name>*dbprefix*admin_sections</name>
  1699. <declaration>
  1700. <field>
  1701. <name>id</name>
  1702. <type>text</type>
  1703. <default></default>
  1704. <notnull>false</notnull>
  1705. <length>64</length>
  1706. </field>
  1707. <field>
  1708. <name>class</name>
  1709. <type>text</type>
  1710. <default></default>
  1711. <notnull>true</notnull>
  1712. <length>255</length>
  1713. </field>
  1714. <field>
  1715. <name>priority</name>
  1716. <type>integer</type>
  1717. <default></default>
  1718. <notnull>true</notnull>
  1719. <length>1</length>
  1720. </field>
  1721. <index>
  1722. <name>admin_sections_id_index</name>
  1723. <primary>true</primary>
  1724. <field>
  1725. <name>id</name>
  1726. <sorting>ascending</sorting>
  1727. </field>
  1728. </index>
  1729. <index>
  1730. <name>admin_sections_class</name>
  1731. <unique>true</unique>
  1732. <field>
  1733. <name>class</name>
  1734. <sorting>ascending</sorting>
  1735. </field>
  1736. </index>
  1737. </declaration>
  1738. </table>
  1739. <table>
  1740. <!-- Extra admin settings -->
  1741. <name>*dbprefix*admin_settings</name>
  1742. <declaration>
  1743. <field>
  1744. <name>id</name>
  1745. <type>integer</type>
  1746. <default>0</default>
  1747. <notnull>true</notnull>
  1748. <autoincrement>1</autoincrement>
  1749. <length>4</length>
  1750. </field>
  1751. <field>
  1752. <name>class</name>
  1753. <type>text</type>
  1754. <default></default>
  1755. <notnull>true</notnull>
  1756. <length>255</length>
  1757. </field>
  1758. <!-- id of the section, foreign key: admin_sections.id -->
  1759. <field>
  1760. <name>section</name>
  1761. <type>text</type>
  1762. <default></default>
  1763. <notnull>false</notnull>
  1764. <length>64</length>
  1765. </field>
  1766. <field>
  1767. <name>priority</name>
  1768. <type>integer</type>
  1769. <default></default>
  1770. <notnull>true</notnull>
  1771. <length>1</length>
  1772. </field>
  1773. <index>
  1774. <name>admin_settings_id_index</name>
  1775. <primary>true</primary>
  1776. <field>
  1777. <name>id</name>
  1778. <sorting>ascending</sorting>
  1779. </field>
  1780. </index>
  1781. <index>
  1782. <name>admin_settings_class</name>
  1783. <unique>true</unique>
  1784. <field>
  1785. <name>class</name>
  1786. <sorting>ascending</sorting>
  1787. </field>
  1788. </index>
  1789. <index>
  1790. <name>admin_settings_section</name>
  1791. <unique>false</unique>
  1792. <field>
  1793. <name>section</name>
  1794. <sorting>ascending</sorting>
  1795. </field>
  1796. </index>
  1797. </declaration>
  1798. </table>
  1799. <table>
  1800. <name>*dbprefix*accounts</name>
  1801. <declaration>
  1802. <field>
  1803. <name>uid</name>
  1804. <type>text</type>
  1805. <default></default>
  1806. <notnull>true</notnull>
  1807. <length>64</length>
  1808. </field>
  1809. <field>
  1810. <name>data</name>
  1811. <type>clob</type>
  1812. <default></default>
  1813. <notnull>true</notnull>
  1814. </field>
  1815. <index>
  1816. <name>uid_index</name>
  1817. <primary>true</primary>
  1818. <unique>true</unique>
  1819. <field>
  1820. <name>uid</name>
  1821. <sorting>ascending</sorting>
  1822. </field>
  1823. </index>
  1824. </declaration>
  1825. </table>
  1826. </database>