annotate plugins/calendar/drivers/kolab/SQL/postgres.initial.sql @ 3:f6fe4b6ae66a

calendar plugin nearly as distributed
author Charlie Root
date Sat, 13 Jan 2018 08:56:12 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
1 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
2 * Roundcube Calendar Kolab backend
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
3 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
4 * @author Sergey Sidlyarenko
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
5 * @licence GNU AGPL
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
6 **/
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
7
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
8 CREATE TABLE IF NOT EXISTS kolab_alarms (
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
9 alarm_id character varying(255) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
10 user_id integer NOT NULL
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
11 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
12 notifyat timestamp without time zone DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
13 dismissed smallint NOT NULL DEFAULT 0,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
14 PRIMARY KEY(alarm_id)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
15 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
16
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
17 CREATE INDEX kolab_alarms_user_id_idx ON kolab_alarms (user_id);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
18
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
19 CREATE TABLE IF NOT EXISTS itipinvitations (
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
20 token character varying(64) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
21 event_uid character varying(255) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
22 user_id integer NOT NULL
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
23 REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
24 event text NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
25 expires timestamp without time zone DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
26 cancelled smallint NOT NULL DEFAULT 0,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
27 PRIMARY KEY(token)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
28 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
29
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
30 CREATE INDEX itipinvitations_user_id_event_uid_idx ON itipinvitations (user_id, event_uid);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
31
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
32 INSERT INTO system (name, value) VALUES ('calendar-kolab-version', '2014041700');