From 66effbfe0827fc61fff6d248797a894213ad20d6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 28 May 2016 17:46:24 +0200 Subject: upgrade to sabre32 --- .../sabre/dav/examples/sql/mysql.addressbook.sql | 6 +- vendor/sabre/dav/examples/sql/mysql.calendars.sql | 20 +++++-- vendor/sabre/dav/examples/sql/pgsql.calendars.sql | 70 +++++++++++++--------- vendor/sabre/dav/examples/sql/pgsql.principals.sql | 8 --- vendor/sabre/dav/examples/sql/sqlite.calendars.sql | 20 +++++-- 5 files changed, 76 insertions(+), 48 deletions(-) (limited to 'vendor/sabre/dav/examples/sql') diff --git a/vendor/sabre/dav/examples/sql/mysql.addressbook.sql b/vendor/sabre/dav/examples/sql/mysql.addressbook.sql index 9ec88babe..5ec8428a7 100644 --- a/vendor/sabre/dav/examples/sql/mysql.addressbook.sql +++ b/vendor/sabre/dav/examples/sql/mysql.addressbook.sql @@ -6,7 +6,7 @@ CREATE TABLE addressbooks ( description TEXT, synctoken INT(11) UNSIGNED NOT NULL DEFAULT '1', UNIQUE(principaluri(100), uri(100)) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE cards ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -16,7 +16,7 @@ CREATE TABLE cards ( lastmodified INT(11) UNSIGNED, etag VARBINARY(32), size INT(11) UNSIGNED NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE addressbookchanges ( id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, @@ -25,4 +25,4 @@ CREATE TABLE addressbookchanges ( addressbookid INT(11) UNSIGNED NOT NULL, operation TINYINT(1) NOT NULL, INDEX addressbookid_synctoken (addressbookid, synctoken) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/vendor/sabre/dav/examples/sql/mysql.calendars.sql b/vendor/sabre/dav/examples/sql/mysql.calendars.sql index d41f11076..21c5bcb44 100644 --- a/vendor/sabre/dav/examples/sql/mysql.calendars.sql +++ b/vendor/sabre/dav/examples/sql/mysql.calendars.sql @@ -10,22 +10,34 @@ CREATE TABLE calendarobjects ( firstoccurence INT(11) UNSIGNED, lastoccurence INT(11) UNSIGNED, uid VARBINARY(200), - UNIQUE(calendarid, uri) + UNIQUE(calendarid, uri), + INDEX calendarid_time (calendarid, firstoccurence) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE calendars ( id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + synctoken INTEGER UNSIGNED NOT NULL DEFAULT '1', + components VARBINARY(21) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE calendarinstances ( + id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + calendarid INTEGER UNSIGNED NOT NULL, principaluri VARBINARY(100), + access TINYINT(1) NOT NULL DEFAULT '1' COMMENT '1 = owner, 2 = read, 3 = readwrite', displayname VARCHAR(100), uri VARBINARY(200), - synctoken INTEGER UNSIGNED NOT NULL DEFAULT '1', description TEXT, calendarorder INT(11) UNSIGNED NOT NULL DEFAULT '0', calendarcolor VARBINARY(10), timezone TEXT, - components VARBINARY(21), transparent TINYINT(1) NOT NULL DEFAULT '0', - UNIQUE(principaluri, uri) + share_href VARBINARY(100), + share_displayname VARCHAR(100), + share_invitestatus TINYINT(1) NOT NULL DEFAULT '2' COMMENT '1 = noresponse, 2 = accepted, 3 = declined, 4 = invalid', + UNIQUE(principaluri, uri), + UNIQUE(calendarid, principaluri), + UNIQUE(calendarid, share_href) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE calendarchanges ( diff --git a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql index d31084b86..67dc41a5a 100644 --- a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql +++ b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql @@ -1,27 +1,6 @@ -CREATE TABLE calendars ( - id SERIAL NOT NULL, - principaluri VARCHAR(100), - displayname VARCHAR(100), - uri VARCHAR(200), - 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' -); - -ALTER TABLE ONLY calendars - ADD CONSTRAINT calendars_pkey PRIMARY KEY (id); - -CREATE UNIQUE INDEX calendars_ukey - ON calendars USING btree (principaluri, uri); - CREATE TABLE calendarobjects ( id SERIAL NOT NULL, - calendardata TEXT, + calendardata BYTEA, uri VARCHAR(200), calendarid INTEGER NOT NULL, lastmodified INTEGER, @@ -39,9 +18,46 @@ ALTER TABLE ONLY calendarobjects CREATE UNIQUE INDEX calendarobjects_ukey ON calendarobjects USING btree (calendarid, uri); -ALTER TABLE ONLY calendarobjects - ADD CONSTRAINT calendarobjects_calendarid_fkey FOREIGN KEY (calendarid) REFERENCES calendars(id) - ON DELETE CASCADE; + +CREATE TABLE calendars ( + id SERIAL NOT NULL, + synctoken INTEGER NOT NULL DEFAULT 1, + components VARCHAR(21) +); + +ALTER TABLE ONLY calendars + ADD CONSTRAINT calendars_pkey PRIMARY KEY (id); + + +CREATE TABLE calendarinstances ( + id SERIAL NOT NULL, + calendarid INTEGER NOT NULL, + principaluri VARCHAR(100), + access SMALLINT NOT NULL DEFAULT '1', -- '1 = owner, 2 = read, 3 = readwrite' + displayname VARCHAR(100), + uri VARCHAR(200), + description TEXT, + calendarorder INTEGER NOT NULL DEFAULT 0, + calendarcolor VARCHAR(10), + timezone TEXT, + transparent SMALLINT NOT NULL DEFAULT '0', + share_href VARCHAR(100), + share_displayname VARCHAR(100), + share_invitestatus SMALLINT NOT NULL DEFAULT '2' -- '1 = noresponse, 2 = accepted, 3 = declined, 4 = invalid' +); + +ALTER TABLE ONLY calendarinstances + ADD CONSTRAINT calendarinstances_pkey PRIMARY KEY (id); + +CREATE UNIQUE INDEX calendarinstances_principaluri_uri + ON calendarinstances USING btree (principaluri, uri); + + +CREATE UNIQUE INDEX calendarinstances_principaluri_calendarid + ON calendarinstances USING btree (principaluri, calendarid); + +CREATE UNIQUE INDEX calendarinstances_principaluri_share_href + ON calendarinstances USING btree (principaluri, share_href); CREATE TABLE calendarsubscriptions ( id SERIAL NOT NULL, @@ -78,10 +94,6 @@ ALTER TABLE ONLY calendarchanges 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), diff --git a/vendor/sabre/dav/examples/sql/pgsql.principals.sql b/vendor/sabre/dav/examples/sql/pgsql.principals.sql index 9157acde0..5a65260a2 100644 --- a/vendor/sabre/dav/examples/sql/pgsql.principals.sql +++ b/vendor/sabre/dav/examples/sql/pgsql.principals.sql @@ -23,14 +23,6 @@ ALTER TABLE ONLY groupmembers CREATE UNIQUE INDEX groupmembers_ukey ON groupmembers USING btree (principal_id, member_id); -ALTER TABLE ONLY groupmembers - ADD CONSTRAINT groupmembers_principal_id_fkey FOREIGN KEY (principal_id) REFERENCES principals(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'), ('principals/admin/calendar-proxy-read', null, null), diff --git a/vendor/sabre/dav/examples/sql/sqlite.calendars.sql b/vendor/sabre/dav/examples/sql/sqlite.calendars.sql index a8654032d..1c8070496 100644 --- a/vendor/sabre/dav/examples/sql/sqlite.calendars.sql +++ b/vendor/sabre/dav/examples/sql/sqlite.calendars.sql @@ -14,16 +14,28 @@ CREATE TABLE calendarobjects ( CREATE TABLE calendars ( id integer primary key asc NOT NULL, - principaluri text NOT NULL, + synctoken integer DEFAULT 1 NOT NULL, + components text NOT NULL +); + +CREATE TABLE calendarinstances ( + id integer primary key asc NOT NULL, + calendarid integer NOT NULL, + principaluri text NULL, + access integer COMMENT '1 = owner, 2 = read, 3 = readwrite' NOT NULL DEFAULT '1', displayname text, uri text NOT NULL, - synctoken integer DEFAULT 1 NOT NULL, description text, calendarorder integer, calendarcolor text, timezone text, - components text NOT NULL, - transparent bool + transparent bool, + share_href text, + share_displayname text, + share_invitestatus integer DEFAULT '2', + UNIQUE (principaluri, uri), + UNIQUE (calendarid, principaluri), + UNIQUE (calendarid, share_href) ); CREATE TABLE calendarchanges ( -- cgit v1.2.3