1
0

db_structure.xml 40 KB

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