Newer
Older
<?xml version="1.0" encoding="utf-8" ?>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<!--
Namespaced Key-Value Store for Application Configuration.
- Keys are namespaced per appid.
- E.g. (core, global_cache_gc_lastrun) -> 1385463286
<name>*dbprefix*appconfig</name>
<declaration>
<field>
<name>appid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>32</length>
</field>
<field>
<name>configkey</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>configvalue</name>
<type>clob</type>
<index>
<name>appconfig_appid_key_index</name>
<primary>true</primary>
<unique>true</unique>
<field>
<name>appid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>configkey</name>
<sorting>ascending</sorting>
</field>
</index>

Frank Karlitschek
committed
<index>
<name>appconfig_config_key_index</name>
<field>
<name>configkey</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>appconfig_appid_key</name>
<field>
<name>appid</name>
<sorting>ascending</sorting>
</field>
</index>
<!--
Bidirectional Map for Storage Names and Storage Ids.
- Assigns each storage name a unique storage id integer.
- Long storage names are hashed.
- E.g. local::/tmp/ <-> 2
- E.g. b5db994aa8c6625100e418406c798269 <-> 27
<name>*dbprefix*storages</name>
<declaration>
<field>
<name>id</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>64</length>
</field>
<field>
<name>numeric_id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>
<index>
<name>storages_id_index</name>
<unique>true</unique>
<field>
<name>id</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<table>
<name>*dbprefix*file_map</name>
<declaration>
<field>
<name>logic_path</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>512</length>
</field>
<field>
<name>logic_path_hash</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>32</length>
</field>
<field>
<name>physic_path</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>512</length>
</field>
<field>
<name>physic_path_hash</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>32</length>
</field>
<index>
<name>file_map_lp_index</name>
<unique>true</unique>
<field>
<name>logic_path_hash</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>file_map_pp_index</name>
<unique>true</unique>
<field>
<name>physic_path_hash</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<!--
Bidirectional Map for Mimetypes and Mimetype Id
- Assigns each mimetype (and supertype) a unique mimetype id integer.
- E.g. application <-> 5
- E.g. application/pdf <-> 6
<name>*dbprefix*mimetypes</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>
<field>
<name>mimetype</name>
<type>text</type>
<default></default>
<notnull>true</notnull>

Michael Gapczynski
committed
<length>255</length>
</field>
<index>
<name>mimetype_id_index</name>
<unique>true</unique>
<field>
<name>mimetype</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<!--
Main file table containing one row for each directory and file.
- Assigns a unique integer fileid to each file (and directory)
- Assigns an etag to each file (and directory)
- Caches various file/dir properties such as:
- path (filename, e.g. files/combinatoricslib-2.0_doc.zip)
- path_hash = md5(path)
- name (basename, e.g. combinatoricslib-2.0_doc.zip)
- size (for directories this is the sum of all contained file sizes)
-->
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<!-- Foreign Key storages::numeric_id -->
<field>
<name>path</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
</field>
<field>
<name>path_hash</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>32</length>
</field>
<!-- Foreign Key filecache::fileid -->
<field>
<name>parent</name>
<type>integer</type>
<default></default>
<notnull>true</notnull>
<notnull>false</notnull>
<!-- Foreign Key mimetypes::id -->
<default></default>
<notnull>true</notnull>
<!-- Foreign Key mimetypes::id -->
<default></default>
<notnull>true</notnull>
<field>
<name>storage_mtime</name>
<type>integer</type>
<default></default>
<notnull>true</notnull>
<length>4</length>
</field>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<field>
<name>unencrypted_size</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>8</length>
</field>
<field>
<name>etag</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<field>
<name>permissions</name>
<type>integer</type>
<default>0</default>
<notnull>false</notnull>
<length>4</length>
</field>
<index>
<name>fs_storage_path_hash</name>
<sorting>ascending</sorting>
</field>
<field>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>fs_parent_name_hash</name>
<field>
<name>parent</name>
<sorting>ascending</sorting>
</field>
<field>
<name>name</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>fs_storage_mimetype</name>
<field>
<name>storage</name>
<sorting>ascending</sorting>
</field>
<field>
<name>mimetype</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>fs_storage_mimepart</name>
<field>
<name>storage</name>
<sorting>ascending</sorting>
</field>
<field>
<name>mimepart</name>
<sorting>ascending</sorting>
</field>
</index>

Frank Karlitschek
committed
<index>
<name>fs_storage_size</name>
<field>
<name>storage</name>
<sorting>ascending</sorting>
</field>
<field>
<name>size</name>
<sorting>ascending</sorting>
</field>
<field>
<name>fileid</name>
</field>
</index>
</declaration>
</table>
<table>
<!--
Stores which groups have which users as members in an n:m relationship.
- Maps group id (gid) to a set of users (uid)
- Maps user id (uid) to a set of groups (gid) (but without index)
-->
<name>*dbprefix*group_user</name>
<declaration>
<field>
<name>gid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>uid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<index>
<name>gu_gid_uid_index</name>
<primary>true</primary>
<unique>true</unique>
<field>
<name>gid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>uid</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<table>
<!--
Stores which groups have which users as admins in an n:m relationship.
- Maps group id (gid) to a set of users (uid)
- Maps user id (uid) to a set of groups (gid)
NOTE: This could (very likely) be reduced to a single bit in group_user
instead of repeating varchars gid and uid here
<name>*dbprefix*group_admin</name>
<declaration>
<field>
<name>gid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>uid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>

Frank Karlitschek
committed
<index>
<name>group_admin_uid</name>
<field>
<name>uid</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>ga_gid_uid_index</name>
<primary>true</primary>
<unique>true</unique>
<field>
<name>gid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>uid</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<table>
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<name>*dbprefix*groups</name>
<declaration>
<field>
<name>gid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<index>
<name>groups_pKey</name>
<primary>true</primary>
<field>
<name>gid</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<table>
<!--
Locks held by WebDAV clients via OC_Connector_Sabre_Locks.
-->
<name>*dbprefix*locks</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<unsigned>true</unsigned>
<length>4</length>
</field>
<field>
<name>userid</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>64</length>
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
</field>
<field>
<name>owner</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>100</length>
</field>
<field>
<name>timeout</name>
<type>integer</type>
<notnull>false</notnull>
<unsigned>true</unsigned>
<length>4</length>
</field>
<field>
<name>created</name>
<type>integer</type>
<notnull>false</notnull>
<length>8</length>
</field>
<field>
<name>token</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>100</length>
</field>
<field>
<name>scope</name>
<type>integer</type>
<notnull>false</notnull>
<length>1</length>
</field>
<field>
<name>depth</name>
<type>integer</type>
<notnull>false</notnull>
<length>1</length>
</field>
<field>
<name>uri</name>
<type>clob</type>
<notnull>false</notnull>
</field>
</declaration>
</table>
<table>
<!--
Namespaced Key-Value Store for User Preferences
- Keys are namespaced per userid and appid.
- E.g. (admin, files, cache_version) -> 5
-->
<name>*dbprefix*preferences</name>
<declaration>
<field>
<name>userid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>appid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>32</length>
</field>
<field>
<name>configkey</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>configvalue</name>
<type>clob</type>
<notnull>false</notnull>
</field>
<name>pref_userid_appid_key_index</name>
<primary>true</primary>
<unique>true</unique>
<field>
<name>userid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>appid</name>
<sorting>ascending</sorting>
</field>
<field>
<name>configkey</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<table>
<name>*dbprefix*properties</name>
<declaration>
<field>
<name>id</name>
<autoincrement>1</autoincrement>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>
<field>
<name>userid</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>propertypath</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>255</length>
</field>
<field>
<name>propertyname</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>255</length>
</field>
<field>
<name>propertyvalue</name>
<type>text</type>
<notnull>true</notnull>
<length>255</length>
</field>
<name>property_index</name>
<field>
<name>userid</name>
<sorting>ascending</sorting>
</field>
</declaration>
</table>
<table>
<!--
Shares of all types (user-to-user, external-via-link, etc.)
-->
<name>*dbprefix*share</name>
<declaration>
<field>
<name>id</name>
<autoincrement>1</autoincrement>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>4</length>
</field>
<field>
<name>share_type</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>
<field>
<name>share_with</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>255</length>
</field>
<field>
<name>uid_owner</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
<field>
<name>parent</name>
<type>integer</type>
<notnull>false</notnull>
<length>4</length>
</field>
<field>
<name>item_type</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>item_source</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>255</length>
</field>
<field>
<name>item_target</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>255</length>
</field>
<field>
<name>file_source</name>
<type>integer</type>
<notnull>false</notnull>
<length>4</length>
</field>
<field>
<name>file_target</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>512</length>
</field>
<field>
<name>permissions</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>
<field>
<name>stime</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>8</length>
</field>
<!-- Whether the receiver accepted the share, if share_with is set. -->
<field>
<name>accepted</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>
<field>
<name>expiration</name>
<type>timestamp</type>
<default></default>
<notnull>false</notnull>
</field>
<field>
<name>token</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>32</length>
</field>
<field>
<name>mail_send</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>
<index>
<name>item_share_type_index</name>
<field>
<name>item_type</name>
<sorting>ascending</sorting>
</field>
<field>
<name>share_type</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>file_source_index</name>
<field>
<name>file_source</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>token_index</name>
<field>
<name>token</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
<table>
<!--
Scheduled background jobs.
See OC\BackgroundJob\JobList.
-->
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<unsigned>true</unsigned>
<length>4</length>
</field>
<field>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>255</length>
<type>text</type>
<default></default>
<notnull>true</notnull>
<index>
<name>job_class_index</name>
<field>
<name>class</name>
<sorting>ascending</sorting>
</field>
</index>