From 0b02a6d123b2014705998c94ddf3d460948d3eac Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Tue, 10 May 2016 17:26:44 -0700
Subject: initial sabre upgrade (needs lots of work - to wit: authentication,
 redo the browser interface, and rework event export/import)

---
 vendor/sabre/dav/examples/sql/pgsql.calendars.sql | 59 +++++++++++++++++++++--
 1 file changed, 55 insertions(+), 4 deletions(-)

(limited to 'vendor/sabre/dav/examples/sql/pgsql.calendars.sql')

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
+);
-- 
cgit v1.2.3


From 66effbfe0827fc61fff6d248797a894213ad20d6 Mon Sep 17 00:00:00 2001
From: Mario Vavti <mario@mariovavti.com>
Date: Sat, 28 May 2016 17:46:24 +0200
Subject: upgrade to sabre32

---
 vendor/sabre/dav/examples/sql/pgsql.calendars.sql | 70 +++++++++++++----------
 1 file changed, 41 insertions(+), 29 deletions(-)

(limited to 'vendor/sabre/dav/examples/sql/pgsql.calendars.sql')

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),
-- 
cgit v1.2.3


From aab9766c53e42c3141d0497fce78977d262efbc1 Mon Sep 17 00:00:00 2001
From: Mario Vavti <mario@mariovavti.com>
Date: Sun, 29 May 2016 00:33:28 +0200
Subject: missed some files

---
 vendor/sabre/dav/examples/sql/pgsql.calendars.sql | 105 ----------------------
 1 file changed, 105 deletions(-)
 delete mode 100644 vendor/sabre/dav/examples/sql/pgsql.calendars.sql

(limited to 'vendor/sabre/dav/examples/sql/pgsql.calendars.sql')

diff --git a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql b/vendor/sabre/dav/examples/sql/pgsql.calendars.sql
deleted file mode 100644
index 67dc41a5a..000000000
--- a/vendor/sabre/dav/examples/sql/pgsql.calendars.sql
+++ /dev/null
@@ -1,105 +0,0 @@
-CREATE TABLE calendarobjects (
-    id SERIAL NOT NULL,
-    calendardata BYTEA,
-    uri VARCHAR(200),
-    calendarid INTEGER NOT NULL,
-    lastmodified INTEGER,
-    etag VARCHAR(32),
-    size INTEGER NOT NULL,
-    componenttype VARCHAR(8),
-    firstoccurence INTEGER,
-    lastoccurence INTEGER,
-    uid VARCHAR(200)
-);
-
-ALTER TABLE ONLY calendarobjects
-    ADD CONSTRAINT calendarobjects_pkey PRIMARY KEY (id);
-
-CREATE UNIQUE INDEX calendarobjects_ukey
-    ON calendarobjects USING btree (calendarid, uri);
-
-
-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,
-    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);
-
-CREATE TABLE schedulingobjects (
-    id SERIAL NOT NULL,
-    principaluri VARCHAR(255),
-    calendardata BYTEA,
-    uri VARCHAR(200),
-    lastmodified INTEGER,
-    etag VARCHAR(32),
-    size INTEGER NOT NULL
-);
-- 
cgit v1.2.3

