1CREATE TABLE calendarobjects (
2    id integer primary key asc,
3    calendardata blob,
4    uri text,
5    calendarid integer,
6    lastmodified integer,
7    etag text,
8    size integer,
9    componenttype text,
10    firstoccurence integer,
11    lastoccurence integer,
12    uid text
13);
14
15CREATE TABLE calendars (
16    id integer primary key asc,
17    principaluri text,
18    displayname text,
19    uri text,
20    synctoken integer,
21    description text,
22    calendarorder integer,
23    calendarcolor text,
24    timezone text,
25    components text,
26    transparent bool
27);
28
29CREATE TABLE calendarchanges (
30    id integer primary key asc,
31    uri text,
32    synctoken integer,
33    calendarid integer,
34    operation integer
35);
36
37CREATE INDEX calendarid_synctoken ON calendarchanges (calendarid, synctoken);
38
39CREATE TABLE calendarsubscriptions (
40    id integer primary key asc,
41    uri text,
42    principaluri text,
43    source text,
44    displayname text,
45    refreshrate text,
46    calendarorder integer,
47    calendarcolor text,
48    striptodos bool,
49    stripalarms bool,
50    stripattachments bool,
51    lastmodified int
52);
53
54CREATE TABLE schedulingobjects (
55    id integer primary key asc,
56    principaluri text,
57    calendardata blob,
58    uri text,
59    lastmodified integer,
60    etag text,
61    size integer
62);
63
64CREATE INDEX principaluri_uri ON calendarsubscriptions (principaluri, uri);
65