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>
<field>
<name>available</name>
<type>integer</type>
<default>1</default>
<notnull>true</notnull>
</field>
<field>
<name>last_checked</name>
<type>integer</type>
</field>
<index>
<name>storages_id_index</name>
<unique>true</unique>
<field>
<name>id</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!-- a list of all mounted storage per user, populated on filesystem setup -->
<table>
<name>*dbprefix*mounts</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>
<field>
<name>storage_id</name>
<type>integer</type>
<notnull>true</notnull>
</field>
<!-- fileid of the root of the mount, foreign key: oc_filecache.fileid -->
<field>
<name>root_id</name>
<type>integer</type>
<notnull>true</notnull>
</field>
<field>
<name>user_id</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>mount_point</name>
<type>text</type>
<notnull>true</notnull>
<length>4000</length>
</field>
<index>
<name>mounts_user_index</name>
<unique>false</unique>
<field>
<name>user_id</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>mounts_storage_index</name>
<unique>false</unique>
<field>
<name>storage_id</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>mounts_root_index</name>
<unique>false</unique>
<field>
<name>root_id</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>mounts_user_root_index</name>
<unique>true</unique>
<field>
<name>user_id</name>
<sorting>ascending</sorting>
</field>
<field>
<name>root_id</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>
<field>
<name>checksum</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<length>255</length>
</field>
<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>
<index>
<name>gu_uid_index</name>
<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>
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
<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>
<!--
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>
<!-- This is the owner of the share
which does not have to be the initiator of the share -->
<field>
<name>uid_owner</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>64</length>
</field>
<!-- Foreign Key users::uid -->
<!-- This is the initiator of the share -->
<name>uid_initiator</name>
<type>text</type>
<default></default>
<notnull>false</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>

Joas Schilling
committed
<!-- timestamp when the job was executed the last time -->

Joas Schilling
committed
<field>
<!-- timestamp when the job was checked if it needs execution the last time -->
<name>last_checked</name>
<type>integer</type>
<default></default>
<notnull>false</notnull>
</field>
<field>
<!-- timestamp when the job was reserved the last time, 1 day timeout -->
<name>reserved_at</name>
<type>integer</type>
<default></default>
<notnull>false</notnull>
</field>
<index>
<name>job_class_index</name>
<field>
<name>class</name>
<sorting>ascending</sorting>
</field>
</index>