diff options
author | Daniel Lange <DLange@git.local> | 2016-03-07 15:53:16 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-03-07 15:53:16 +0100 |
commit | 50569114acdc64e7c7cae1498635d3f821517c30 (patch) | |
tree | 13d6fe76af33134fbfb2286930fb6603047f9299 /calendar/drivers/caldav/SQL/postgres.initial.sql | |
parent | c210d30de6c62e7f7867bb32651349ddf455d9e6 (diff) | |
download | roundcube_calendar-50569114acdc64e7c7cae1498635d3f821517c30.tar.gz roundcube_calendar-50569114acdc64e7c7cae1498635d3f821517c30.tar.bz2 roundcube_calendar-50569114acdc64e7c7cae1498635d3f821517c30.zip |
Initial commit of the Faster IT roundcube_calendar plugin distribution
This includes:
* Kolab plugins 3.2.9 (calendar and libcalendaring)
* CalDAV driver 3.2.8
* .htaccess files for at least some security
* SabreDAV updated to 1.8.12 (Jan 2015 release)
* Support for CURLOPT_SSL_* settings to allow self-signed certificates
* Small fixes & improved documentation
Diffstat (limited to 'calendar/drivers/caldav/SQL/postgres.initial.sql')
-rw-r--r-- | calendar/drivers/caldav/SQL/postgres.initial.sql | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/calendar/drivers/caldav/SQL/postgres.initial.sql b/calendar/drivers/caldav/SQL/postgres.initial.sql new file mode 100644 index 0000000..f49da4e --- /dev/null +++ b/calendar/drivers/caldav/SQL/postgres.initial.sql @@ -0,0 +1,51 @@ +/** + * CalDAV Client + * + * @version @package_version@ + * @author Hugo Slabbert <hugo@slabnet.com> + * + * Copyright (C) 2014, Hugo Slabbert <hugo@slabnet.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +CREATE TYPE caldav_type AS ENUM ('vcal','vevent','vtodo',''); + +CREATE TABLE IF NOT EXISTS caldav_props ( + obj_id int NOT NULL, + obj_type caldav_type NOT NULL, + url varchar(255) NOT NULL, + tag varchar(255) DEFAULT NULL, + username varchar(255) DEFAULT NULL, + pass varchar(1024) DEFAULT NULL, + last_change timestamp without time zone DEFAULT now() NOT NULL, + PRIMARY KEY (obj_id, obj_type) +); + +CREATE OR REPLACE FUNCTION upd_timestamp() RETURNS TRIGGER +LANGUAGE plpgsql +AS +$$ +BEGIN + NEW.last_change = CURRENT_TIMESTAMP; + RETURN NEW; +END; +$$; + +CREATE TRIGGER update_timestamp + BEFORE INSERT OR UPDATE + ON caldav_props + FOR EACH ROW + EXECUTE PROCEDURE upd_timestamp(); + |