db_structure.xml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100
  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. <table>
  1683. <!-- Extra admin settings sections -->
  1684. <name>*dbprefix*admin_sections</name>
  1685. <declaration>
  1686. <field>
  1687. <name>id</name>
  1688. <type>text</type>
  1689. <default></default>
  1690. <notnull>false</notnull>
  1691. <length>64</length>
  1692. </field>
  1693. <field>
  1694. <name>class</name>
  1695. <type>text</type>
  1696. <default></default>
  1697. <notnull>true</notnull>
  1698. <length>255</length>
  1699. </field>
  1700. <field>
  1701. <name>priority</name>
  1702. <type>integer</type>
  1703. <default></default>
  1704. <notnull>true</notnull>
  1705. <length>1</length>
  1706. </field>
  1707. <index>
  1708. <name>admin_sections_id_index</name>
  1709. <primary>true</primary>
  1710. <field>
  1711. <name>id</name>
  1712. <sorting>ascending</sorting>
  1713. </field>
  1714. </index>
  1715. <index>
  1716. <name>admin_sections_class</name>
  1717. <unique>true</unique>
  1718. <field>
  1719. <name>class</name>
  1720. <sorting>ascending</sorting>
  1721. </field>
  1722. </index>
  1723. </declaration>
  1724. </table>
  1725. <table>
  1726. <!-- Extra admin settings -->
  1727. <name>*dbprefix*admin_settings</name>
  1728. <declaration>
  1729. <field>
  1730. <name>id</name>
  1731. <type>integer</type>
  1732. <default>0</default>
  1733. <notnull>true</notnull>
  1734. <autoincrement>1</autoincrement>
  1735. <length>4</length>
  1736. </field>
  1737. <field>
  1738. <name>class</name>
  1739. <type>text</type>
  1740. <default></default>
  1741. <notnull>true</notnull>
  1742. <length>255</length>
  1743. </field>
  1744. <!-- id of the section, foreign key: admin_sections.id -->
  1745. <field>
  1746. <name>section</name>
  1747. <type>text</type>
  1748. <default></default>
  1749. <notnull>false</notnull>
  1750. <length>64</length>
  1751. </field>
  1752. <field>
  1753. <name>priority</name>
  1754. <type>integer</type>
  1755. <default></default>
  1756. <notnull>true</notnull>
  1757. <length>1</length>
  1758. </field>
  1759. <index>
  1760. <name>admin_settings_id_index</name>
  1761. <primary>true</primary>
  1762. <field>
  1763. <name>id</name>
  1764. <sorting>ascending</sorting>
  1765. </field>
  1766. </index>
  1767. <index>
  1768. <name>admin_settings_class</name>
  1769. <unique>true</unique>
  1770. <field>
  1771. <name>class</name>
  1772. <sorting>ascending</sorting>
  1773. </field>
  1774. </index>
  1775. <index>
  1776. <name>admin_settings_section</name>
  1777. <unique>false</unique>
  1778. <field>
  1779. <name>section</name>
  1780. <sorting>ascending</sorting>
  1781. </field>
  1782. </index>
  1783. </declaration>
  1784. </table>
  1785. </database>