db_structure.xml 37 KB

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