diff --git a/dba/davical.sql b/dba/davical.sql index 20f5b7e1..a06a5646 100644 --- a/dba/davical.sql +++ b/dba/davical.sql @@ -406,6 +406,23 @@ CREATE TABLE calendar_alarm ( trigger_state CHAR DEFAULT 'N' -- 'N' => 'New/Needs setting', 'A' = 'Active', 'O' = 'Old' ); + +CREATE TABLE calendar_attendee_email_status ( + email_status_id INT8 PRIMARY KEY, + description TEXT NOT NULL +); + +INSERT INTO calendar_attendee_email_status (email_status_id, description) + VALUES + (1, 'waiting for invitation to be sent'), + (2, 'invitation has been sent'), + (3, 'waiting for schedule change to be sent'), + (4, 'schedule change has been sent'), + (11, 'attendee has accepted'), + (12, 'attendee indicated maybe'), + (13, 'attendee has refused') +; + CREATE TABLE calendar_attendee ( dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, status TEXT, @@ -417,6 +434,8 @@ CREATE TABLE calendar_attendee ( property TEXT, -- The full text of the property attendee_state TEXT, -- Internal DAViCal processing state weak_etag TEXT, -- The week_etag applying for this attendee state + email_status INT REFERENCES calendar_attendee_email_status(email_status_id) DEFAULT 1 NOT NULL, + is_remote BOOLEAN DEFAULT false, PRIMARY KEY ( dav_id, attendee ) ); @@ -449,4 +468,4 @@ $$ LANGUAGE plpgsql ; ALTER TABLE dav_binding ADD CONSTRAINT "dav_name_does_not_exist" CHECK (NOT real_path_exists(dav_name)); -SELECT new_db_revision(1,2,12, 'Decembre' ); +SELECT new_db_revision(1,3,1, 'Styczeń' ); diff --git a/dba/patches/1.3.1.sql b/dba/patches/1.3.1.sql new file mode 100644 index 00000000..2777e448 --- /dev/null +++ b/dba/patches/1.3.1.sql @@ -0,0 +1,36 @@ + +-- Notable enhancement: Add/Alter tables for dealing with remote attendee handling + +BEGIN; +SELECT check_db_revision(1,2,12); + + +CREATE TABLE calendar_attendee_email_status ( + email_status_id INT8 PRIMARY KEY, + description TEXT NOT NULL +); + +INSERT INTO calendar_attendee_email_status (email_status_id, description) + VALUES + (1, 'waiting for invitation to be sent'), + (2, 'invitation has been sent'), + (3, 'waiting for schedule change to be sent'), + (4, 'schedule change has been sent'), + (11, 'attendee has accepted'), + (12, 'attendee indicated maybe'), + (13, 'attendee has refused') +; + + +ALTER TABLE calendar_attendee + ADD COLUMN email_status INT REFERENCES calendar_attendee_email_status(email_status_id) DEFAULT 1 NOT NULL ; + +ALTER TABLE calendar_attendee + ADD COLUMN is_remote BOOLEAN DEFAULT FALSE; + +-- A new year! http://blogs.transparent.com/polish/names-of-the-months-and-their-meaning/ +SELECT new_db_revision(1,3,1, 'Styczeń' ); + +COMMIT; +ROLLBACK; + diff --git a/testing/tests/regression-suite/Really-Upgrade-Database.result b/testing/tests/regression-suite/Really-Upgrade-Database.result index 6ac7ed41..7273afdb 100644 --- a/testing/tests/regression-suite/Really-Upgrade-Database.result +++ b/testing/tests/regression-suite/Really-Upgrade-Database.result @@ -1,4 +1,4 @@ -The database is version 9.4 currently at revision 1.2.11. +The database is version 9.5 currently at revision 1.3.1. No patches were applied. Supported locales updated. Updated view: dav_principal.sql applied.