[3733] | 1 | |
---|
| 2 | -- This database update adds support for tickets to be handed out to grant |
---|
| 3 | -- specific access to a collection or individual resource, as read-only or |
---|
| 4 | -- read-write. A table is also added to manage WebDAV binding, in line |
---|
| 5 | -- with http://tools.ietf.org/html/draft-ietf-webdav-bind. |
---|
| 6 | |
---|
| 7 | BEGIN; |
---|
| 8 | SELECT check_db_revision(1,2,7); |
---|
| 9 | |
---|
| 10 | ALTER TABLE caldav_data ADD COLUMN weak_etag TEXT DEFAULT NULL; |
---|
| 11 | ALTER TABLE collection DROP COLUMN in_freebusy_set; |
---|
| 12 | |
---|
| 13 | CREATE TABLE access_ticket ( |
---|
| 14 | ticket_id TEXT PRIMARY KEY, |
---|
| 15 | dav_owner_id INT8 NOT NULL REFERENCES principal(principal_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 16 | privileges BIT(24), |
---|
| 17 | target_collection_id INT8 NOT NULL REFERENCES collection(collection_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 18 | target_resource_id INT8 REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 19 | expires TIMESTAMP |
---|
| 20 | ); |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | -- At this point we only support binding collections |
---|
| 24 | CREATE TABLE dav_binding ( |
---|
| 25 | bind_id INT8 DEFAULT nextval('dav_id_seq') PRIMARY KEY, |
---|
| 26 | bound_source_id INT8 REFERENCES collection(collection_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 27 | access_ticket_id TEXT REFERENCES access_ticket(ticket_id) ON UPDATE CASCADE ON DELETE SET NULL, |
---|
| 28 | dav_owner_id INT8 NOT NULL REFERENCES principal(principal_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 29 | parent_container TEXT NOT NULL, |
---|
| 30 | dav_name TEXT UNIQUE NOT NULL, |
---|
| 31 | dav_displayname TEXT |
---|
| 32 | ); |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | CREATE TABLE addressbook_resource ( |
---|
| 36 | dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE PRIMARY KEY, |
---|
| 37 | version TEXT, |
---|
| 38 | uid TEXT, |
---|
| 39 | nickname TEXT, |
---|
| 40 | fn TEXT, -- fullname |
---|
| 41 | n TEXT, -- Name Surname;First names |
---|
| 42 | note TEXT, |
---|
| 43 | org TEXT, |
---|
| 44 | url TEXT |
---|
| 45 | ); |
---|
| 46 | |
---|
| 47 | CREATE TABLE addressbook_address_adr ( |
---|
| 48 | dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 49 | type TEXT, |
---|
| 50 | adr TEXT, |
---|
| 51 | property TEXT -- The full text of the property |
---|
| 52 | ); |
---|
| 53 | |
---|
| 54 | CREATE TABLE addressbook_address_tel ( |
---|
| 55 | dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 56 | type TEXT, |
---|
| 57 | tel TEXT, |
---|
| 58 | property TEXT -- The full text of the property |
---|
| 59 | ); |
---|
| 60 | |
---|
| 61 | CREATE TABLE addressbook_address_email ( |
---|
| 62 | dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 63 | type TEXT, |
---|
| 64 | email TEXT, |
---|
| 65 | property TEXT -- The full text of the property |
---|
| 66 | ); |
---|
| 67 | |
---|
| 68 | |
---|
| 69 | CREATE TABLE calendar_alarm ( |
---|
| 70 | dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 71 | action TEXT, |
---|
| 72 | trigger TEXT, |
---|
| 73 | summary TEXT, |
---|
| 74 | description TEXT, |
---|
| 75 | next_trigger TIMESTAMP WITH TIME ZONE, |
---|
| 76 | component TEXT -- The full text of the component |
---|
| 77 | ); |
---|
| 78 | |
---|
| 79 | CREATE TABLE calendar_attendee ( |
---|
| 80 | dav_id INT8 NOT NULL REFERENCES caldav_data(dav_id) ON UPDATE CASCADE ON DELETE CASCADE, |
---|
| 81 | status TEXT, |
---|
| 82 | partstat TEXT, |
---|
| 83 | cn TEXT, |
---|
| 84 | attendee TEXT, |
---|
| 85 | role TEXT, |
---|
| 86 | rsvp BOOLEAN, |
---|
| 87 | property TEXT, -- The full text of the property |
---|
| 88 | PRIMARY KEY ( dav_id, attendee ) |
---|
| 89 | ); |
---|
| 90 | |
---|
| 91 | SELECT new_db_revision(1,2,8, 'Août' ); |
---|
| 92 | |
---|
| 93 | COMMIT; |
---|
| 94 | ROLLBACK; |
---|
| 95 | |
---|