db_structure.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269
  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. <table>
  109. <name>*dbprefix*file_map</name>
  110. <declaration>
  111. <field>
  112. <name>logic_path</name>
  113. <type>text</type>
  114. <default></default>
  115. <notnull>true</notnull>
  116. <length>512</length>
  117. </field>
  118. <field>
  119. <name>logic_path_hash</name>
  120. <type>text</type>
  121. <default></default>
  122. <notnull>true</notnull>
  123. <length>32</length>
  124. </field>
  125. <field>
  126. <name>physic_path</name>
  127. <type>text</type>
  128. <default></default>
  129. <notnull>true</notnull>
  130. <length>512</length>
  131. </field>
  132. <field>
  133. <name>physic_path_hash</name>
  134. <type>text</type>
  135. <default></default>
  136. <notnull>true</notnull>
  137. <length>32</length>
  138. </field>
  139. <index>
  140. <name>file_map_lp_index</name>
  141. <primary>true</primary>
  142. <unique>true</unique>
  143. <field>
  144. <name>logic_path_hash</name>
  145. <sorting>ascending</sorting>
  146. </field>
  147. </index>
  148. <index>
  149. <name>file_map_pp_index</name>
  150. <unique>true</unique>
  151. <field>
  152. <name>physic_path_hash</name>
  153. <sorting>ascending</sorting>
  154. </field>
  155. </index>
  156. </declaration>
  157. </table>
  158. <table>
  159. <!--
  160. Bidirectional Map for Mimetypes and Mimetype Id
  161. - Assigns each mimetype (and supertype) a unique mimetype id integer.
  162. - E.g. application <-> 5
  163. - E.g. application/pdf <-> 6
  164. -->
  165. <name>*dbprefix*mimetypes</name>
  166. <declaration>
  167. <field>
  168. <name>id</name>
  169. <type>integer</type>
  170. <default>0</default>
  171. <notnull>true</notnull>
  172. <autoincrement>1</autoincrement>
  173. <length>4</length>
  174. </field>
  175. <field>
  176. <name>mimetype</name>
  177. <type>text</type>
  178. <default></default>
  179. <notnull>true</notnull>
  180. <length>255</length>
  181. </field>
  182. <index>
  183. <name>mimetype_id_index</name>
  184. <unique>true</unique>
  185. <field>
  186. <name>mimetype</name>
  187. <sorting>ascending</sorting>
  188. </field>
  189. </index>
  190. </declaration>
  191. </table>
  192. <table>
  193. <!--
  194. Main file table containing one row for each directory and file.
  195. - Assigns a unique integer fileid to each file (and directory)
  196. - Assigns an etag to each file (and directory)
  197. - Caches various file/dir properties such as:
  198. - path (filename, e.g. files/combinatoricslib-2.0_doc.zip)
  199. - path_hash = md5(path)
  200. - name (basename, e.g. combinatoricslib-2.0_doc.zip)
  201. - size (for directories this is the sum of all contained file sizes)
  202. -->
  203. <name>*dbprefix*filecache</name>
  204. <declaration>
  205. <field>
  206. <name>fileid</name>
  207. <type>integer</type>
  208. <default>0</default>
  209. <notnull>true</notnull>
  210. <autoincrement>1</autoincrement>
  211. <length>4</length>
  212. </field>
  213. <!-- Foreign Key storages::numeric_id -->
  214. <field>
  215. <name>storage</name>
  216. <type>integer</type>
  217. <default></default>
  218. <notnull>true</notnull>
  219. <length>4</length>
  220. </field>
  221. <field>
  222. <name>path</name>
  223. <type>text</type>
  224. <default></default>
  225. <notnull>false</notnull>
  226. <length>4000</length>
  227. </field>
  228. <field>
  229. <name>path_hash</name>
  230. <type>text</type>
  231. <default></default>
  232. <notnull>true</notnull>
  233. <length>32</length>
  234. </field>
  235. <!-- Foreign Key filecache::fileid -->
  236. <field>
  237. <name>parent</name>
  238. <type>integer</type>
  239. <default></default>
  240. <notnull>true</notnull>
  241. <length>4</length>
  242. </field>
  243. <field>
  244. <name>name</name>
  245. <type>text</type>
  246. <default></default>
  247. <notnull>false</notnull>
  248. <length>250</length>
  249. </field>
  250. <!-- Foreign Key mimetypes::id -->
  251. <field>
  252. <name>mimetype</name>
  253. <type>integer</type>
  254. <default></default>
  255. <notnull>true</notnull>
  256. <length>4</length>
  257. </field>
  258. <!-- Foreign Key mimetypes::id -->
  259. <field>
  260. <name>mimepart</name>
  261. <type>integer</type>
  262. <default></default>
  263. <notnull>true</notnull>
  264. <length>4</length>
  265. </field>
  266. <field>
  267. <name>size</name>
  268. <type>integer</type>
  269. <default></default>
  270. <notnull>true</notnull>
  271. <length>8</length>
  272. </field>
  273. <field>
  274. <name>mtime</name>
  275. <type>integer</type>
  276. <default></default>
  277. <notnull>true</notnull>
  278. <length>4</length>
  279. </field>
  280. <field>
  281. <name>storage_mtime</name>
  282. <type>integer</type>
  283. <default></default>
  284. <notnull>true</notnull>
  285. <length>4</length>
  286. </field>
  287. <field>
  288. <name>encrypted</name>
  289. <type>integer</type>
  290. <default>0</default>
  291. <notnull>true</notnull>
  292. <length>4</length>
  293. </field>
  294. <field>
  295. <name>unencrypted_size</name>
  296. <type>integer</type>
  297. <default>0</default>
  298. <notnull>true</notnull>
  299. <length>8</length>
  300. </field>
  301. <field>
  302. <name>etag</name>
  303. <type>text</type>
  304. <default></default>
  305. <notnull>false</notnull>
  306. <length>40</length>
  307. </field>
  308. <field>
  309. <name>permissions</name>
  310. <type>integer</type>
  311. <default>0</default>
  312. <notnull>false</notnull>
  313. <length>4</length>
  314. </field>
  315. <index>
  316. <name>fs_storage_path_hash</name>
  317. <unique>true</unique>
  318. <field>
  319. <name>storage</name>
  320. <sorting>ascending</sorting>
  321. </field>
  322. <field>
  323. <name>path_hash</name>
  324. <sorting>ascending</sorting>
  325. </field>
  326. </index>
  327. <index>
  328. <name>fs_parent_name_hash</name>
  329. <field>
  330. <name>parent</name>
  331. <sorting>ascending</sorting>
  332. </field>
  333. <field>
  334. <name>name</name>
  335. <sorting>ascending</sorting>
  336. </field>
  337. </index>
  338. <index>
  339. <name>fs_storage_mimetype</name>
  340. <field>
  341. <name>storage</name>
  342. <sorting>ascending</sorting>
  343. </field>
  344. <field>
  345. <name>mimetype</name>
  346. <sorting>ascending</sorting>
  347. </field>
  348. </index>
  349. <index>
  350. <name>fs_storage_mimepart</name>
  351. <field>
  352. <name>storage</name>
  353. <sorting>ascending</sorting>
  354. </field>
  355. <field>
  356. <name>mimepart</name>
  357. <sorting>ascending</sorting>
  358. </field>
  359. </index>
  360. <index>
  361. <name>fs_storage_size</name>
  362. <field>
  363. <name>storage</name>
  364. <sorting>ascending</sorting>
  365. </field>
  366. <field>
  367. <name>size</name>
  368. <sorting>ascending</sorting>
  369. </field>
  370. <field>
  371. <name>fileid</name>
  372. </field>
  373. </index>
  374. </declaration>
  375. </table>
  376. <table>
  377. <!--
  378. Stores which groups have which users as members in an n:m relationship.
  379. - Maps group id (gid) to a set of users (uid)
  380. - Maps user id (uid) to a set of groups (gid) (but without index)
  381. -->
  382. <name>*dbprefix*group_user</name>
  383. <declaration>
  384. <!-- Foreign Key groups::gid -->
  385. <field>
  386. <name>gid</name>
  387. <type>text</type>
  388. <default></default>
  389. <notnull>true</notnull>
  390. <length>64</length>
  391. </field>
  392. <!-- Foreign Key users::uid -->
  393. <field>
  394. <name>uid</name>
  395. <type>text</type>
  396. <default></default>
  397. <notnull>true</notnull>
  398. <length>64</length>
  399. </field>
  400. <index>
  401. <name>gu_gid_uid_index</name>
  402. <primary>true</primary>
  403. <unique>true</unique>
  404. <field>
  405. <name>gid</name>
  406. <sorting>ascending</sorting>
  407. </field>
  408. <field>
  409. <name>uid</name>
  410. <sorting>ascending</sorting>
  411. </field>
  412. </index>
  413. <index>
  414. <name>gu_uid_index</name>
  415. <field>
  416. <name>uid</name>
  417. <sorting>ascending</sorting>
  418. </field>
  419. </index>
  420. </declaration>
  421. </table>
  422. <table>
  423. <!--
  424. Stores which groups have which users as admins in an n:m relationship.
  425. - Maps group id (gid) to a set of users (uid)
  426. - Maps user id (uid) to a set of groups (gid)
  427. NOTE: This could (very likely) be reduced to a single bit in group_user
  428. instead of repeating varchars gid and uid here
  429. -->
  430. <name>*dbprefix*group_admin</name>
  431. <declaration>
  432. <!-- Foreign Key groups::gid -->
  433. <field>
  434. <name>gid</name>
  435. <type>text</type>
  436. <default></default>
  437. <notnull>true</notnull>
  438. <length>64</length>
  439. </field>
  440. <!-- Foreign Key users::uid -->
  441. <field>
  442. <name>uid</name>
  443. <type>text</type>
  444. <default></default>
  445. <notnull>true</notnull>
  446. <length>64</length>
  447. </field>
  448. <index>
  449. <name>group_admin_uid</name>
  450. <field>
  451. <name>uid</name>
  452. <sorting>ascending</sorting>
  453. </field>
  454. </index>
  455. <index>
  456. <name>ga_gid_uid_index</name>
  457. <primary>true</primary>
  458. <unique>true</unique>
  459. <field>
  460. <name>gid</name>
  461. <sorting>ascending</sorting>
  462. </field>
  463. <field>
  464. <name>uid</name>
  465. <sorting>ascending</sorting>
  466. </field>
  467. </index>
  468. </declaration>
  469. </table>
  470. <table>
  471. <!--
  472. A simple list of groups.
  473. -->
  474. <name>*dbprefix*groups</name>
  475. <declaration>
  476. <field>
  477. <name>gid</name>
  478. <type>text</type>
  479. <default></default>
  480. <notnull>true</notnull>
  481. <length>64</length>
  482. </field>
  483. <index>
  484. <name>groups_pKey</name>
  485. <primary>true</primary>
  486. <field>
  487. <name>gid</name>
  488. <sorting>ascending</sorting>
  489. </field>
  490. </index>
  491. </declaration>
  492. </table>
  493. <table>
  494. <!--
  495. Namespaced Key-Value Store for User Preferences
  496. - Keys are namespaced per userid and appid.
  497. - E.g. (admin, files, cache_version) -> 5
  498. -->
  499. <name>*dbprefix*preferences</name>
  500. <declaration>
  501. <!-- Foreign Key users::uid -->
  502. <field>
  503. <name>userid</name>
  504. <type>text</type>
  505. <default></default>
  506. <notnull>true</notnull>
  507. <length>64</length>
  508. </field>
  509. <field>
  510. <name>appid</name>
  511. <type>text</type>
  512. <default></default>
  513. <notnull>true</notnull>
  514. <length>32</length>
  515. </field>
  516. <field>
  517. <name>configkey</name>
  518. <type>text</type>
  519. <default></default>
  520. <notnull>true</notnull>
  521. <length>64</length>
  522. </field>
  523. <field>
  524. <name>configvalue</name>
  525. <type>clob</type>
  526. <notnull>false</notnull>
  527. </field>
  528. <index>
  529. <name>pref_userid_appid_key_index</name>
  530. <primary>true</primary>
  531. <unique>true</unique>
  532. <field>
  533. <name>userid</name>
  534. <sorting>ascending</sorting>
  535. </field>
  536. <field>
  537. <name>appid</name>
  538. <sorting>ascending</sorting>
  539. </field>
  540. <field>
  541. <name>configkey</name>
  542. <sorting>ascending</sorting>
  543. </field>
  544. </index>
  545. </declaration>
  546. </table>
  547. <table>
  548. <!--
  549. WebDAV properties.
  550. -->
  551. <name>*dbprefix*properties</name>
  552. <declaration>
  553. <field>
  554. <name>id</name>
  555. <autoincrement>1</autoincrement>
  556. <type>integer</type>
  557. <default>0</default>
  558. <notnull>true</notnull>
  559. <length>4</length>
  560. </field>
  561. <!-- Foreign Key users::uid -->
  562. <field>
  563. <name>userid</name>
  564. <type>text</type>
  565. <default></default>
  566. <notnull>true</notnull>
  567. <length>64</length>
  568. </field>
  569. <field>
  570. <name>propertypath</name>
  571. <type>text</type>
  572. <default></default>
  573. <notnull>true</notnull>
  574. <length>255</length>
  575. </field>
  576. <field>
  577. <name>propertyname</name>
  578. <type>text</type>
  579. <default></default>
  580. <notnull>true</notnull>
  581. <length>255</length>
  582. </field>
  583. <field>
  584. <name>propertyvalue</name>
  585. <type>text</type>
  586. <notnull>true</notnull>
  587. <length>255</length>
  588. </field>
  589. <index>
  590. <name>property_index</name>
  591. <field>
  592. <name>userid</name>
  593. <sorting>ascending</sorting>
  594. </field>
  595. </index>
  596. </declaration>
  597. </table>
  598. <table>
  599. <!--
  600. Shares of all types (user-to-user, external-via-link, etc.)
  601. -->
  602. <name>*dbprefix*share</name>
  603. <declaration>
  604. <field>
  605. <name>id</name>
  606. <autoincrement>1</autoincrement>
  607. <type>integer</type>
  608. <default>0</default>
  609. <notnull>true</notnull>
  610. <length>4</length>
  611. </field>
  612. <!-- Constant OCP\Share::SHARE_TYPE_* -->
  613. <field>
  614. <name>share_type</name>
  615. <type>integer</type>
  616. <default>0</default>
  617. <notnull>true</notnull>
  618. <length>1</length>
  619. </field>
  620. <!-- Foreign Key users::uid or NULL -->
  621. <field>
  622. <name>share_with</name>
  623. <type>text</type>
  624. <default></default>
  625. <notnull>false</notnull>
  626. <length>255</length>
  627. </field>
  628. <!-- Foreign Key users::uid -->
  629. <field>
  630. <name>uid_owner</name>
  631. <type>text</type>
  632. <default></default>
  633. <notnull>true</notnull>
  634. <length>64</length>
  635. </field>
  636. <!-- Foreign Key share::id or NULL -->
  637. <field>
  638. <name>parent</name>
  639. <type>integer</type>
  640. <notnull>false</notnull>
  641. <length>4</length>
  642. </field>
  643. <!-- E.g. file or folder -->
  644. <field>
  645. <name>item_type</name>
  646. <type>text</type>
  647. <default></default>
  648. <notnull>true</notnull>
  649. <length>64</length>
  650. </field>
  651. <!-- Foreign Key filecache::fileid -->
  652. <field>
  653. <name>item_source</name>
  654. <type>text</type>
  655. <default></default>
  656. <notnull>false</notnull>
  657. <length>255</length>
  658. </field>
  659. <field>
  660. <name>item_target</name>
  661. <type>text</type>
  662. <default></default>
  663. <notnull>false</notnull>
  664. <length>255</length>
  665. </field>
  666. <!-- Foreign Key filecache::fileid -->
  667. <field>
  668. <name>file_source</name>
  669. <type>integer</type>
  670. <notnull>false</notnull>
  671. <length>4</length>
  672. </field>
  673. <field>
  674. <name>file_target</name>
  675. <type>text</type>
  676. <default></default>
  677. <notnull>false</notnull>
  678. <length>512</length>
  679. </field>
  680. <!-- Permission bitfield -->
  681. <field>
  682. <name>permissions</name>
  683. <type>integer</type>
  684. <default>0</default>
  685. <notnull>true</notnull>
  686. <length>1</length>
  687. </field>
  688. <!-- Time of share creation -->
  689. <field>
  690. <name>stime</name>
  691. <type>integer</type>
  692. <default>0</default>
  693. <notnull>true</notnull>
  694. <length>8</length>
  695. </field>
  696. <!-- Whether the receiver accepted the share, if share_with is set. -->
  697. <field>
  698. <name>accepted</name>
  699. <type>integer</type>
  700. <default>0</default>
  701. <notnull>true</notnull>
  702. <length>1</length>
  703. </field>
  704. <!-- Time of share expiration -->
  705. <field>
  706. <name>expiration</name>
  707. <type>timestamp</type>
  708. <default></default>
  709. <notnull>false</notnull>
  710. </field>
  711. <field>
  712. <name>token</name>
  713. <type>text</type>
  714. <default></default>
  715. <notnull>false</notnull>
  716. <length>32</length>
  717. </field>
  718. <field>
  719. <name>mail_send</name>
  720. <type>integer</type>
  721. <default>0</default>
  722. <notnull>true</notnull>
  723. <length>1</length>
  724. </field>
  725. <index>
  726. <name>item_share_type_index</name>
  727. <field>
  728. <name>item_type</name>
  729. <sorting>ascending</sorting>
  730. </field>
  731. <field>
  732. <name>share_type</name>
  733. <sorting>ascending</sorting>
  734. </field>
  735. </index>
  736. <index>
  737. <name>file_source_index</name>
  738. <field>
  739. <name>file_source</name>
  740. <sorting>ascending</sorting>
  741. </field>
  742. </index>
  743. <index>
  744. <name>token_index</name>
  745. <field>
  746. <name>token</name>
  747. <sorting>ascending</sorting>
  748. </field>
  749. </index>
  750. </declaration>
  751. </table>
  752. <table>
  753. <!--
  754. Scheduled background jobs.
  755. See OC\BackgroundJob\JobList.
  756. -->
  757. <name>*dbprefix*jobs</name>
  758. <declaration>
  759. <field>
  760. <name>id</name>
  761. <type>integer</type>
  762. <default>0</default>
  763. <notnull>true</notnull>
  764. <autoincrement>1</autoincrement>
  765. <unsigned>true</unsigned>
  766. <length>4</length>
  767. </field>
  768. <field>
  769. <name>class</name>
  770. <type>text</type>
  771. <default></default>
  772. <notnull>true</notnull>
  773. <length>255</length>
  774. </field>
  775. <field>
  776. <name>argument</name>
  777. <type>text</type>
  778. <default></default>
  779. <notnull>true</notnull>
  780. <length>4000</length>
  781. </field>
  782. <field>
  783. <name>last_run</name>
  784. <type>integer</type>
  785. <default></default>
  786. <notnull>false</notnull>
  787. </field>
  788. <index>
  789. <name>job_class_index</name>
  790. <field>
  791. <name>class</name>
  792. <sorting>ascending</sorting>
  793. </field>
  794. </index>
  795. </declaration>
  796. </table>
  797. <table>
  798. <!--
  799. List of usernames, their display name and login password.
  800. -->
  801. <name>*dbprefix*users</name>
  802. <declaration>
  803. <field>
  804. <name>uid</name>
  805. <type>text</type>
  806. <default></default>
  807. <notnull>true</notnull>
  808. <length>64</length>
  809. </field>
  810. <field>
  811. <name>displayname</name>
  812. <type>text</type>
  813. <default></default>
  814. <length>64</length>
  815. </field>
  816. <field>
  817. <name>password</name>
  818. <type>text</type>
  819. <default></default>
  820. <notnull>true</notnull>
  821. <length>255</length>
  822. </field>
  823. <index>
  824. <name>users_pKey</name>
  825. <primary>true</primary>
  826. <field>
  827. <name>uid</name>
  828. <sorting>ascending</sorting>
  829. </field>
  830. </index>
  831. </declaration>
  832. </table>
  833. <table>
  834. <!--
  835. List of tags (category) + a unique tag id (id) per user (uid) and type.
  836. -->
  837. <name>*dbprefix*vcategory</name>
  838. <declaration>
  839. <field>
  840. <name>id</name>
  841. <type>integer</type>
  842. <default>0</default>
  843. <notnull>true</notnull>
  844. <autoincrement>1</autoincrement>
  845. <unsigned>true</unsigned>
  846. <length>4</length>
  847. </field>
  848. <!-- Foreign Key users::uid -->
  849. <field>
  850. <name>uid</name>
  851. <type>text</type>
  852. <default></default>
  853. <notnull>true</notnull>
  854. <length>64</length>
  855. </field>
  856. <field>
  857. <name>type</name>
  858. <type>text</type>
  859. <default></default>
  860. <notnull>true</notnull>
  861. <length>64</length>
  862. </field>
  863. <field>
  864. <name>category</name>
  865. <type>text</type>
  866. <default></default>
  867. <notnull>true</notnull>
  868. <length>255</length>
  869. </field>
  870. <index>
  871. <name>uid_index</name>
  872. <field>
  873. <name>uid</name>
  874. <sorting>ascending</sorting>
  875. </field>
  876. </index>
  877. <index>
  878. <name>type_index</name>
  879. <field>
  880. <name>type</name>
  881. <sorting>ascending</sorting>
  882. </field>
  883. </index>
  884. <index>
  885. <name>category_index</name>
  886. <field>
  887. <name>category</name>
  888. <sorting>ascending</sorting>
  889. </field>
  890. </index>
  891. </declaration>
  892. </table>
  893. <table>
  894. <!--
  895. Object-Tag associations per tag type.
  896. -->
  897. <name>*dbprefix*vcategory_to_object</name>
  898. <declaration>
  899. <field>
  900. <name>objid</name>
  901. <type>integer</type>
  902. <default>0</default>
  903. <notnull>true</notnull>
  904. <unsigned>true</unsigned>
  905. <length>4</length>
  906. </field>
  907. <!-- Foreign Key vcategory::id -->
  908. <field>
  909. <name>categoryid</name>
  910. <type>integer</type>
  911. <default>0</default>
  912. <notnull>true</notnull>
  913. <unsigned>true</unsigned>
  914. <length>4</length>
  915. </field>
  916. <field>
  917. <name>type</name>
  918. <type>text</type>
  919. <default></default>
  920. <notnull>true</notnull>
  921. <length>64</length>
  922. </field>
  923. <index>
  924. <primary>true</primary>
  925. <unique>true</unique>
  926. <name>category_object_index</name>
  927. <field>
  928. <name>categoryid</name>
  929. <sorting>ascending</sorting>
  930. </field>
  931. <field>
  932. <name>objid</name>
  933. <sorting>ascending</sorting>
  934. </field>
  935. <field>
  936. <name>type</name>
  937. <sorting>ascending</sorting>
  938. </field>
  939. </index>
  940. <index>
  941. <name>vcategory_objectd_index</name>
  942. <field>
  943. <name>objid</name>
  944. <sorting>ascending</sorting>
  945. </field>
  946. <field>
  947. <name>type</name>
  948. <sorting>ascending</sorting>
  949. </field>
  950. </index>
  951. </declaration>
  952. </table>
  953. <table>
  954. <!--
  955. Namespaced Key-Value Store for arbitrary data.
  956. - Keys are namespaced per userid and appid.
  957. - E.g. (admin, files, foo) -> bar
  958. -->
  959. <name>*dbprefix*privatedata</name>
  960. <declaration>
  961. <field>
  962. <name>keyid</name>
  963. <type>integer</type>
  964. <default>0</default>
  965. <notnull>true</notnull>
  966. <unsigned>true</unsigned>
  967. <length>4</length>
  968. <autoincrement>1</autoincrement>
  969. </field>
  970. <!-- Foreign Key users::uid -->
  971. <field>
  972. <name>user</name>
  973. <type>text</type>
  974. <default></default>
  975. <notnull>true</notnull>
  976. <length>64</length>
  977. </field>
  978. <field>
  979. <name>app</name>
  980. <type>text</type>
  981. <default></default>
  982. <notnull>true</notnull>
  983. <length>255</length>
  984. </field>
  985. <field>
  986. <name>key</name>
  987. <type>text</type>
  988. <default></default>
  989. <notnull>true</notnull>
  990. <length>255</length>
  991. </field>
  992. <field>
  993. <name>value</name>
  994. <type>text</type>
  995. <default></default>
  996. <notnull>true</notnull>
  997. <length>255</length>
  998. </field>
  999. <index>
  1000. <primary>true</primary>
  1001. <unique>true</unique>
  1002. <name>keyid_index</name>
  1003. <field>
  1004. <name>keyid</name>
  1005. <sorting>ascending</sorting>
  1006. </field>
  1007. </index>
  1008. </declaration>
  1009. </table>
  1010. <table>
  1011. <!--
  1012. Table for storing transactional file locking
  1013. -->
  1014. <name>*dbprefix*file_locks</name>
  1015. <declaration>
  1016. <field>
  1017. <name>id</name>
  1018. <type>integer</type>
  1019. <default>0</default>
  1020. <notnull>true</notnull>
  1021. <unsigned>true</unsigned>
  1022. <length>4</length>
  1023. <autoincrement>1</autoincrement>
  1024. </field>
  1025. <field>
  1026. <name>lock</name>
  1027. <type>integer</type>
  1028. <default>0</default>
  1029. <notnull>true</notnull>
  1030. <length>4</length>
  1031. </field>
  1032. <field>
  1033. <name>key</name>
  1034. <type>text</type>
  1035. <notnull>true</notnull>
  1036. <length>64</length>
  1037. </field>
  1038. <field>
  1039. <name>ttl</name>
  1040. <type>integer</type>
  1041. <default>-1</default>
  1042. <notnull>true</notnull>
  1043. <length>4</length>
  1044. </field>
  1045. <index>
  1046. <primary>true</primary>
  1047. <unique>true</unique>
  1048. <name>lock_id_index</name>
  1049. <field>
  1050. <name>id</name>
  1051. <sorting>ascending</sorting>
  1052. </field>
  1053. </index>
  1054. <index>
  1055. <unique>true</unique>
  1056. <name>lock_key_index</name>
  1057. <field>
  1058. <name>key</name>
  1059. <sorting>ascending</sorting>
  1060. </field>
  1061. </index>
  1062. <index>
  1063. <name>lock_ttl_index</name>
  1064. <field>
  1065. <name>ttl</name>
  1066. <sorting>ascending</sorting>
  1067. </field>
  1068. </index>
  1069. </declaration>
  1070. </table>
  1071. </database>