2013-07-07 12:05:24 -04:00
|
|
|
CREATE TABLE addressbooks (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
principaluri text NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
displayname text,
|
2016-08-19 08:58:24 -04:00
|
|
|
uri text NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
description text,
|
2016-08-19 08:58:24 -04:00
|
|
|
synctoken integer DEFAULT 1 NOT NULL
|
2013-07-07 12:05:24 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE cards (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
addressbookid integer NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
carddata blob,
|
2016-08-19 08:58:24 -04:00
|
|
|
uri text NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
lastmodified integer,
|
|
|
|
etag text,
|
|
|
|
size integer
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE addressbookchanges (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
uri text,
|
2016-08-19 08:58:24 -04:00
|
|
|
synctoken integer NOT NULL,
|
|
|
|
addressbookid integer NOT NULL,
|
|
|
|
operation integer NOT NULL
|
2013-07-07 12:05:24 -04:00
|
|
|
);
|
|
|
|
|
2016-01-21 13:20:38 -05:00
|
|
|
CREATE INDEX addressbookid_synctoken ON addressbookchanges (addressbookid, synctoken);
|
2013-07-07 12:05:24 -04:00
|
|
|
CREATE TABLE calendarobjects (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
calendardata blob NOT NULL,
|
|
|
|
uri text NOT NULL,
|
|
|
|
calendarid integer NOT NULL,
|
|
|
|
lastmodified integer NOT NULL,
|
|
|
|
etag text NOT NULL,
|
|
|
|
size integer NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
componenttype text,
|
|
|
|
firstoccurence integer,
|
2016-01-21 13:20:38 -05:00
|
|
|
lastoccurence integer,
|
|
|
|
uid text
|
2013-07-07 12:05:24 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE calendars (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
2019-04-17 16:11:22 -04:00
|
|
|
synctoken integer DEFAULT 1 NOT NULL,
|
|
|
|
components text NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE calendarinstances (
|
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
calendarid integer,
|
|
|
|
principaluri text,
|
|
|
|
access integer,
|
2013-07-07 12:05:24 -04:00
|
|
|
displayname text,
|
2016-08-19 08:58:24 -04:00
|
|
|
uri text NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
description text,
|
|
|
|
calendarorder integer,
|
|
|
|
calendarcolor text,
|
|
|
|
timezone text,
|
2019-04-17 16:11:22 -04:00
|
|
|
transparent bool,
|
|
|
|
share_href text,
|
|
|
|
share_displayname text,
|
|
|
|
share_invitestatus integer DEFAULT '2',
|
|
|
|
UNIQUE (principaluri, uri),
|
|
|
|
UNIQUE (calendarid, principaluri),
|
|
|
|
UNIQUE (calendarid, share_href)
|
2013-07-07 12:05:24 -04:00
|
|
|
);
|
|
|
|
|
2016-01-21 13:20:38 -05:00
|
|
|
CREATE TABLE calendarchanges (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
uri text,
|
2016-08-19 08:58:24 -04:00
|
|
|
synctoken integer NOT NULL,
|
|
|
|
calendarid integer NOT NULL,
|
|
|
|
operation integer NOT NULL
|
2016-01-21 13:20:38 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE INDEX calendarid_synctoken ON calendarchanges (calendarid, synctoken);
|
|
|
|
|
|
|
|
CREATE TABLE calendarsubscriptions (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
uri text NOT NULL,
|
|
|
|
principaluri text NOT NULL,
|
|
|
|
source text NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
displayname text,
|
|
|
|
refreshrate text,
|
|
|
|
calendarorder integer,
|
|
|
|
calendarcolor text,
|
|
|
|
striptodos bool,
|
|
|
|
stripalarms bool,
|
|
|
|
stripattachments bool,
|
|
|
|
lastmodified int
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE schedulingobjects (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
principaluri text NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
calendardata blob,
|
2016-08-19 08:58:24 -04:00
|
|
|
uri text NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
lastmodified integer,
|
2016-08-19 08:58:24 -04:00
|
|
|
etag text NOT NULL,
|
|
|
|
size integer NOT NULL
|
2013-07-07 12:05:24 -04:00
|
|
|
);
|
|
|
|
|
2016-01-21 13:20:38 -05:00
|
|
|
CREATE INDEX principaluri_uri ON calendarsubscriptions (principaluri, uri);
|
|
|
|
BEGIN TRANSACTION;
|
|
|
|
CREATE TABLE locks (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
owner text,
|
|
|
|
timeout integer,
|
|
|
|
created integer,
|
|
|
|
token text,
|
|
|
|
scope integer,
|
|
|
|
depth integer,
|
|
|
|
uri text
|
|
|
|
);
|
|
|
|
COMMIT;
|
2013-07-07 12:05:24 -04:00
|
|
|
CREATE TABLE principals (
|
2016-08-19 08:58:24 -04:00
|
|
|
id INTEGER PRIMARY KEY ASC NOT NULL,
|
|
|
|
uri TEXT NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
email TEXT,
|
|
|
|
displayname TEXT,
|
|
|
|
UNIQUE(uri)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE groupmembers (
|
2016-08-19 08:58:24 -04:00
|
|
|
id INTEGER PRIMARY KEY ASC NOT NULL,
|
|
|
|
principal_id INTEGER NOT NULL,
|
|
|
|
member_id INTEGER NOT NULL,
|
2013-07-07 12:05:24 -04:00
|
|
|
UNIQUE(principal_id, member_id)
|
|
|
|
);
|
|
|
|
|
2016-01-21 13:20:38 -05:00
|
|
|
CREATE TABLE propertystorage (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
path text NOT NULL,
|
|
|
|
name text NOT NULL,
|
|
|
|
valuetype integer NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
value string
|
2013-07-07 12:05:24 -04:00
|
|
|
);
|
2016-01-21 13:20:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
CREATE UNIQUE INDEX path_property ON propertystorage (path, name);
|
|
|
|
CREATE TABLE users (
|
2016-08-19 08:58:24 -04:00
|
|
|
id integer primary key asc NOT NULL,
|
|
|
|
username TEXT NOT NULL,
|
|
|
|
digesta1 TEXT NOT NULL,
|
2016-01-21 13:20:38 -05:00
|
|
|
UNIQUE(username)
|
|
|
|
);
|