aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/examples/sql
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/dav/examples/sql
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/dav/examples/sql')
-rw-r--r--vendor/sabre/dav/examples/sql/mysql.addressbook.sql26
-rw-r--r--vendor/sabre/dav/examples/sql/mysql.calendars.sql60
-rw-r--r--vendor/sabre/dav/examples/sql/mysql.locks.sql9
-rw-r--r--vendor/sabre/dav/examples/sql/mysql.principals.sql10
-rw-r--r--vendor/sabre/dav/examples/sql/mysql.users.sql6
-rw-r--r--vendor/sabre/dav/examples/sql/pgsql.addressbook.sql23
-rw-r--r--vendor/sabre/dav/examples/sql/pgsql.calendars.sql59
-rw-r--r--vendor/sabre/dav/examples/sql/pgsql.locks.sql12
-rw-r--r--vendor/sabre/dav/examples/sql/pgsql.principals.sql12
-rw-r--r--vendor/sabre/dav/examples/sql/pgsql.users.sql3
-rw-r--r--vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql25
-rw-r--r--vendor/sabre/dav/examples/sql/sqlite.calendars.sql64
-rw-r--r--vendor/sabre/dav/examples/sql/sqlite.locks.sql2
-rw-r--r--vendor/sabre/dav/examples/sql/sqlite.principals.sql11
-rw-r--r--vendor/sabre/dav/examples/sql/sqlite.users.sql6
15 files changed, 246 insertions, 82 deletions
diff --git a/vendor/sabre/dav/examples/sql/mysql.addressbook.sql b/vendor/sabre/dav/examples/sql/mysql.addressbook.sql
index f603ad4c5..9ec88babe 100644
--- a/vendor/sabre/dav/examples/sql/mysql.addressbook.sql
+++ b/vendor/sabre/dav/examples/sql/mysql.addressbook.sql
@@ -1,18 +1,28 @@
CREATE TABLE addressbooks (
id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
- principaluri VARCHAR(255),
+ principaluri VARBINARY(255),
displayname VARCHAR(255),
- uri VARCHAR(200),
+ uri VARBINARY(200),
description TEXT,
- ctag INT(11) UNSIGNED NOT NULL DEFAULT '1',
- UNIQUE(principaluri, uri)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+ synctoken INT(11) UNSIGNED NOT NULL DEFAULT '1',
+ UNIQUE(principaluri(100), uri(100))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE cards (
id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
addressbookid INT(11) UNSIGNED NOT NULL,
carddata MEDIUMBLOB,
- uri VARCHAR(200),
- lastmodified INT(11) UNSIGNED
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+ uri VARBINARY(200),
+ lastmodified INT(11) UNSIGNED,
+ etag VARBINARY(32),
+ size INT(11) UNSIGNED NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+CREATE TABLE addressbookchanges (
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ uri VARBINARY(200) NOT NULL,
+ synctoken INT(11) UNSIGNED NOT NULL,
+ addressbookid INT(11) UNSIGNED NOT NULL,
+ operation TINYINT(1) NOT NULL,
+ INDEX addressbookid_synctoken (addressbookid, synctoken)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/vendor/sabre/dav/examples/sql/mysql.calendars.sql b/vendor/sabre/dav/examples/sql/mysql.calendars.sql
index a8eb102d1..d41f11076 100644
--- a/vendor/sabre/dav/examples/sql/mysql.calendars.sql
+++ b/vendor/sabre/dav/examples/sql/mysql.calendars.sql
@@ -1,28 +1,64 @@
CREATE TABLE calendarobjects (
- id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
calendardata MEDIUMBLOB,
- uri VARCHAR(200),
+ uri VARBINARY(200),
calendarid INTEGER UNSIGNED NOT NULL,
lastmodified INT(11) UNSIGNED,
- etag VARCHAR(32),
+ etag VARBINARY(32),
size INT(11) UNSIGNED NOT NULL,
- componenttype VARCHAR(8),
+ componenttype VARBINARY(8),
firstoccurence INT(11) UNSIGNED,
lastoccurence INT(11) UNSIGNED,
+ uid VARBINARY(200),
UNIQUE(calendarid, uri)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE calendars (
id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
- principaluri VARCHAR(100),
+ principaluri VARBINARY(100),
displayname VARCHAR(100),
- uri VARCHAR(200),
- ctag INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ uri VARBINARY(200),
+ synctoken INTEGER UNSIGNED NOT NULL DEFAULT '1',
description TEXT,
- calendarorder INTEGER UNSIGNED NOT NULL DEFAULT '0',
- calendarcolor VARCHAR(10),
+ calendarorder INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ calendarcolor VARBINARY(10),
timezone TEXT,
- components VARCHAR(20),
+ components VARBINARY(21),
transparent TINYINT(1) NOT NULL DEFAULT '0',
UNIQUE(principaluri, uri)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE calendarchanges (
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ uri VARBINARY(200) NOT NULL,
+ synctoken INT(11) UNSIGNED NOT NULL,
+ calendarid INT(11) UNSIGNED NOT NULL,
+ operation TINYINT(1) NOT NULL,
+ INDEX calendarid_synctoken (calendarid, synctoken)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE calendarsubscriptions (
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ uri VARBINARY(200) NOT NULL,
+ principaluri VARBINARY(100) NOT NULL,
+ source TEXT,
+ displayname VARCHAR(100),
+ refreshrate VARCHAR(10),
+ calendarorder INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ calendarcolor VARBINARY(10),
+ striptodos TINYINT(1) NULL,
+ stripalarms TINYINT(1) NULL,
+ stripattachments TINYINT(1) NULL,
+ lastmodified INT(11) UNSIGNED,
+ UNIQUE(principaluri, uri)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE schedulingobjects (
+ id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ principaluri VARBINARY(255),
+ calendardata MEDIUMBLOB,
+ uri VARBINARY(200),
+ lastmodified INT(11) UNSIGNED,
+ etag VARBINARY(32),
+ size INT(11) UNSIGNED NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/vendor/sabre/dav/examples/sql/mysql.locks.sql b/vendor/sabre/dav/examples/sql/mysql.locks.sql
index cf3caf4f7..96a3a88d9 100644
--- a/vendor/sabre/dav/examples/sql/mysql.locks.sql
+++ b/vendor/sabre/dav/examples/sql/mysql.locks.sql
@@ -3,11 +3,10 @@ CREATE TABLE locks (
owner VARCHAR(100),
timeout INTEGER UNSIGNED,
created INTEGER,
- token VARCHAR(100),
+ token VARBINARY(100),
scope TINYINT,
depth TINYINT,
- uri VARCHAR(1000),
+ uri VARBINARY(1000),
INDEX(token),
- INDEX(uri)
-);
-
+ INDEX(uri(100))
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/vendor/sabre/dav/examples/sql/mysql.principals.sql b/vendor/sabre/dav/examples/sql/mysql.principals.sql
index da9282818..ea0d16a27 100644
--- a/vendor/sabre/dav/examples/sql/mysql.principals.sql
+++ b/vendor/sabre/dav/examples/sql/mysql.principals.sql
@@ -1,19 +1,17 @@
CREATE TABLE principals (
id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
- uri VARCHAR(200) NOT NULL,
- email VARCHAR(80),
+ uri VARBINARY(200) NOT NULL,
+ email VARBINARY(80),
displayname VARCHAR(80),
- vcardurl VARCHAR(255),
UNIQUE(uri)
-);
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE groupmembers (
id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
principal_id INTEGER UNSIGNED NOT NULL,
member_id INTEGER UNSIGNED NOT NULL,
UNIQUE(principal_id, member_id)
-);
-
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO principals (uri,email,displayname) VALUES
('principals/admin', 'admin@example.org','Administrator'),
diff --git a/vendor/sabre/dav/examples/sql/mysql.users.sql b/vendor/sabre/dav/examples/sql/mysql.users.sql
index 1244f596f..22ac312d5 100644
--- a/vendor/sabre/dav/examples/sql/mysql.users.sql
+++ b/vendor/sabre/dav/examples/sql/mysql.users.sql
@@ -1,9 +1,9 @@
CREATE TABLE users (
id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
- username VARCHAR(50),
- digesta1 VARCHAR(32),
+ username VARBINARY(50),
+ digesta1 VARBINARY(32),
UNIQUE(username)
-);
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO users (username,digesta1) VALUES
('admin', '87fd274b7b6c01e48d7c2f965da8ddf7');
diff --git a/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql b/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql
index c3ca8b291..ef2cc5b9a 100644
--- a/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql
+++ b/vendor/sabre/dav/examples/sql/pgsql.addressbook.sql
@@ -4,7 +4,7 @@ CREATE TABLE addressbooks (
displayname VARCHAR(255),
uri VARCHAR(200),
description TEXT,
- ctag INTEGER NOT NULL DEFAULT 1
+ synctoken INTEGER NOT NULL DEFAULT 1
);
ALTER TABLE ONLY addressbooks
@@ -18,7 +18,9 @@ CREATE TABLE cards (
addressbookid INTEGER NOT NULL,
carddata TEXT,
uri VARCHAR(200),
- lastmodified INTEGER
+ lastmodified INTEGER,
+ etag VARCHAR(32),
+ size INTEGER NOT NULL
);
ALTER TABLE ONLY cards
@@ -31,3 +33,20 @@ ALTER TABLE ONLY cards
ADD CONSTRAINT cards_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id)
ON DELETE CASCADE;
+CREATE TABLE addressbookchanges (
+ id SERIAL NOT NULL,
+ uri VARCHAR(200) NOT NULL,
+ synctoken INTEGER NOT NULL,
+ addressbookid INTEGER NOT NULL,
+ operation SMALLINT NOT NULL
+);
+
+ALTER TABLE ONLY addressbookchanges
+ ADD CONSTRAINT addressbookchanges_pkey PRIMARY KEY (id);
+
+CREATE INDEX addressbookchanges_addressbookid_synctoken_ix
+ ON addressbookchanges USING btree (addressbookid, synctoken);
+
+ALTER TABLE ONLY addressbookchanges
+ ADD CONSTRAINT addressbookchanges_addressbookid_fkey FOREIGN KEY (addressbookid) REFERENCES addressbooks(id)
+ ON DELETE CASCADE;
diff --git a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql
index 23465ae93..d31084b86 100644
--- a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql
+++ b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql
@@ -3,12 +3,13 @@ CREATE TABLE calendars (
principaluri VARCHAR(100),
displayname VARCHAR(100),
uri VARCHAR(200),
- ctag INTEGER NOT NULL DEFAULT 0,
+ synctoken INTEGER NOT NULL DEFAULT 1,
description TEXT,
calendarorder INTEGER NOT NULL DEFAULT 0,
calendarcolor VARCHAR(10),
timezone TEXT,
components VARCHAR(20),
+ uid VARCHAR(200),
transparent SMALLINT NOT NULL DEFAULT '0'
);
@@ -20,15 +21,16 @@ CREATE UNIQUE INDEX calendars_ukey
CREATE TABLE calendarobjects (
id SERIAL NOT NULL,
- calendarid INTEGER NOT NULL,
calendardata TEXT,
uri VARCHAR(200),
+ calendarid INTEGER NOT NULL,
+ lastmodified INTEGER,
etag VARCHAR(32),
size INTEGER NOT NULL,
componenttype VARCHAR(8),
- lastmodified INTEGER,
firstoccurence INTEGER,
- lastoccurence INTEGER
+ lastoccurence INTEGER,
+ uid VARCHAR(200)
);
ALTER TABLE ONLY calendarobjects
@@ -40,3 +42,52 @@ CREATE UNIQUE INDEX calendarobjects_ukey
ALTER TABLE ONLY calendarobjects
ADD CONSTRAINT calendarobjects_calendarid_fkey FOREIGN KEY (calendarid) REFERENCES calendars(id)
ON DELETE CASCADE;
+
+CREATE TABLE calendarsubscriptions (
+ id SERIAL NOT NULL,
+ uri VARCHAR(200) NOT NULL,
+ principaluri VARCHAR(100) NOT NULL,
+ source TEXT,
+ displayname VARCHAR(100),
+ refreshrate VARCHAR(10),
+ calendarorder INTEGER NOT NULL DEFAULT 0,
+ calendarcolor VARCHAR(10),
+ striptodos SMALLINT NULL,
+ stripalarms SMALLINT NULL,
+ stripattachments SMALLINT NULL,
+ lastmodified INTEGER
+);
+
+ALTER TABLE ONLY calendarsubscriptions
+ ADD CONSTRAINT calendarsubscriptions_pkey PRIMARY KEY (id);
+
+CREATE UNIQUE INDEX calendarsubscriptions_ukey
+ ON calendarsubscriptions USING btree (principaluri, uri);
+
+CREATE TABLE calendarchanges (
+ id SERIAL NOT NULL,
+ uri VARCHAR(200) NOT NULL,
+ synctoken INTEGER NOT NULL,
+ calendarid INTEGER NOT NULL,
+ operation SMALLINT NOT NULL DEFAULT 0
+);
+
+ALTER TABLE ONLY calendarchanges
+ ADD CONSTRAINT calendarchanges_pkey PRIMARY KEY (id);
+
+CREATE INDEX calendarchanges_calendarid_synctoken_ix
+ ON calendarchanges USING btree (calendarid, synctoken);
+
+ALTER TABLE ONLY calendarchanges
+ ADD CONSTRAINT calendarchanges_calendar_fk FOREIGN KEY (calendarid) REFERENCES calendars(id)
+ ON DELETE CASCADE;
+
+CREATE TABLE schedulingobjects (
+ id SERIAL NOT NULL,
+ principaluri VARCHAR(255),
+ calendardata BYTEA,
+ uri VARCHAR(200),
+ lastmodified INTEGER,
+ etag VARCHAR(32),
+ size INTEGER NOT NULL
+);
diff --git a/vendor/sabre/dav/examples/sql/pgsql.locks.sql b/vendor/sabre/dav/examples/sql/pgsql.locks.sql
index ca6c82e96..0290528ce 100644
--- a/vendor/sabre/dav/examples/sql/pgsql.locks.sql
+++ b/vendor/sabre/dav/examples/sql/pgsql.locks.sql
@@ -4,10 +4,16 @@ CREATE TABLE locks (
timeout INTEGER,
created INTEGER,
token VARCHAR(100),
- scope smallint,
- depth smallint,
- uri text
+ scope SMALLINT,
+ depth SMALLINT,
+ uri TEXT
);
ALTER TABLE ONLY locks
ADD CONSTRAINT locks_pkey PRIMARY KEY (id);
+
+CREATE INDEX locks_token_ix
+ ON locks USING btree (token);
+
+CREATE INDEX locks_uri_ix
+ ON locks USING btree (uri);
diff --git a/vendor/sabre/dav/examples/sql/pgsql.principals.sql b/vendor/sabre/dav/examples/sql/pgsql.principals.sql
index 4afe51063..9157acde0 100644
--- a/vendor/sabre/dav/examples/sql/pgsql.principals.sql
+++ b/vendor/sabre/dav/examples/sql/pgsql.principals.sql
@@ -1,9 +1,8 @@
CREATE TABLE principals (
id SERIAL NOT NULL,
- uri VARCHAR(100) NOT NULL,
+ uri VARCHAR(200) NOT NULL,
email VARCHAR(80),
- displayname VARCHAR(80),
- vcardurl VARCHAR(255)
+ displayname VARCHAR(80)
);
ALTER TABLE ONLY principals
@@ -28,10 +27,9 @@ ALTER TABLE ONLY groupmembers
ADD CONSTRAINT groupmembers_principal_id_fkey FOREIGN KEY (principal_id) REFERENCES principals(id)
ON DELETE CASCADE;
--- Is this correct correct link ... or not?
--- ALTER TABLE ONLY groupmembers
--- ADD CONSTRAINT groupmembers_member_id_id_fkey FOREIGN KEY (member_id) REFERENCES users(id)
--- ON DELETE CASCADE;
+ALTER TABLE ONLY groupmembers
+ ADD CONSTRAINT groupmembers_member_id_id_fkey FOREIGN KEY (member_id) REFERENCES principals(id)
+ ON DELETE CASCADE;
INSERT INTO principals (uri,email,displayname) VALUES
('principals/admin', 'admin@example.org','Administrator'),
diff --git a/vendor/sabre/dav/examples/sql/pgsql.users.sql b/vendor/sabre/dav/examples/sql/pgsql.users.sql
index 939c931d8..9d6047b8c 100644
--- a/vendor/sabre/dav/examples/sql/pgsql.users.sql
+++ b/vendor/sabre/dav/examples/sql/pgsql.users.sql
@@ -1,8 +1,7 @@
CREATE TABLE users (
id SERIAL NOT NULL,
username VARCHAR(50),
- digesta1 VARCHAR(32),
- UNIQUE(username)
+ digesta1 VARCHAR(32)
);
ALTER TABLE ONLY users
diff --git a/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql b/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql
index aa7639c5f..0baed8bfb 100644
--- a/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql
+++ b/vendor/sabre/dav/examples/sql/sqlite.addressbooks.sql
@@ -1,17 +1,28 @@
CREATE TABLE addressbooks (
- id integer primary key asc,
- principaluri text,
+ id integer primary key asc NOT NULL,
+ principaluri text NOT NULL,
displayname text,
- uri text,
+ uri text NOT NULL,
description text,
- ctag integer
+ synctoken integer DEFAULT 1 NOT NULL
);
CREATE TABLE cards (
- id integer primary key asc,
- addressbookid integer,
+ id integer primary key asc NOT NULL,
+ addressbookid integer NOT NULL,
carddata blob,
+ uri text NOT NULL,
+ lastmodified integer,
+ etag text,
+ size integer
+);
+
+CREATE TABLE addressbookchanges (
+ id integer primary key asc NOT NULL,
uri text,
- lastmodified integer
+ synctoken integer NOT NULL,
+ addressbookid integer NOT NULL,
+ operation integer NOT NULL
);
+CREATE INDEX addressbookid_synctoken ON addressbookchanges (addressbookid, synctoken);
diff --git a/vendor/sabre/dav/examples/sql/sqlite.calendars.sql b/vendor/sabre/dav/examples/sql/sqlite.calendars.sql
index 537789906..a8654032d 100644
--- a/vendor/sabre/dav/examples/sql/sqlite.calendars.sql
+++ b/vendor/sabre/dav/examples/sql/sqlite.calendars.sql
@@ -1,26 +1,64 @@
CREATE TABLE calendarobjects (
- id integer primary key asc,
- calendardata blob,
- uri text,
- calendarid integer,
- lastmodified integer,
- etag text,
- size integer,
+ 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,
componenttype text,
firstoccurence integer,
- lastoccurence integer
+ lastoccurence integer,
+ uid text
);
CREATE TABLE calendars (
- id integer primary key asc,
- principaluri text,
+ id integer primary key asc NOT NULL,
+ principaluri text NOT NULL,
displayname text,
- uri text,
- ctag integer,
+ uri text NOT NULL,
+ synctoken integer DEFAULT 1 NOT NULL,
description text,
calendarorder integer,
calendarcolor text,
timezone text,
- components text,
+ components text NOT NULL,
transparent bool
);
+
+CREATE TABLE calendarchanges (
+ id integer primary key asc NOT NULL,
+ uri text,
+ synctoken integer NOT NULL,
+ calendarid integer NOT NULL,
+ operation integer NOT NULL
+);
+
+CREATE INDEX calendarid_synctoken ON calendarchanges (calendarid, synctoken);
+
+CREATE TABLE calendarsubscriptions (
+ id integer primary key asc NOT NULL,
+ uri text NOT NULL,
+ principaluri text NOT NULL,
+ source text NOT NULL,
+ displayname text,
+ refreshrate text,
+ calendarorder integer,
+ calendarcolor text,
+ striptodos bool,
+ stripalarms bool,
+ stripattachments bool,
+ lastmodified int
+);
+
+CREATE TABLE schedulingobjects (
+ id integer primary key asc NOT NULL,
+ principaluri text NOT NULL,
+ calendardata blob,
+ uri text NOT NULL,
+ lastmodified integer,
+ etag text NOT NULL,
+ size integer NOT NULL
+);
+
+CREATE INDEX principaluri_uri ON calendarsubscriptions (principaluri, uri);
diff --git a/vendor/sabre/dav/examples/sql/sqlite.locks.sql b/vendor/sabre/dav/examples/sql/sqlite.locks.sql
index fd89b41eb..622baea42 100644
--- a/vendor/sabre/dav/examples/sql/sqlite.locks.sql
+++ b/vendor/sabre/dav/examples/sql/sqlite.locks.sql
@@ -1,6 +1,6 @@
BEGIN TRANSACTION;
CREATE TABLE locks (
- id integer primary key asc,
+ id integer primary key asc NOT NULL,
owner text,
timeout integer,
created integer,
diff --git a/vendor/sabre/dav/examples/sql/sqlite.principals.sql b/vendor/sabre/dav/examples/sql/sqlite.principals.sql
index 09dbc4d24..4105156f8 100644
--- a/vendor/sabre/dav/examples/sql/sqlite.principals.sql
+++ b/vendor/sabre/dav/examples/sql/sqlite.principals.sql
@@ -1,16 +1,15 @@
CREATE TABLE principals (
- id INTEGER PRIMARY KEY ASC,
- uri TEXT,
+ id INTEGER PRIMARY KEY ASC NOT NULL,
+ uri TEXT NOT NULL,
email TEXT,
displayname TEXT,
- vcardurl TEXT,
UNIQUE(uri)
);
CREATE TABLE groupmembers (
- id INTEGER PRIMARY KEY ASC,
- principal_id INTEGER,
- member_id INTEGER,
+ id INTEGER PRIMARY KEY ASC NOT NULL,
+ principal_id INTEGER NOT NULL,
+ member_id INTEGER NOT NULL,
UNIQUE(principal_id, member_id)
);
diff --git a/vendor/sabre/dav/examples/sql/sqlite.users.sql b/vendor/sabre/dav/examples/sql/sqlite.users.sql
index f4b2c1674..5597b058a 100644
--- a/vendor/sabre/dav/examples/sql/sqlite.users.sql
+++ b/vendor/sabre/dav/examples/sql/sqlite.users.sql
@@ -1,7 +1,7 @@
CREATE TABLE users (
- id integer primary key asc,
- username TEXT,
- digesta1 TEXT,
+ id integer primary key asc NOT NULL,
+ username TEXT NOT NULL,
+ digesta1 TEXT NOT NULL,
UNIQUE(username)
);