3
|
1 /**
|
|
2 * Roundcube Calendar
|
|
3 *
|
|
4 * Plugin to add a calendar to Roundcube.
|
|
5 *
|
|
6 * @author Lazlo Westerhof
|
|
7 * @author Thomas Bruederli
|
|
8 * @author Albert Lee
|
|
9 * @licence GNU AGPL
|
|
10 * @copyright (c) 2010 Lazlo Westerhof - Netherlands
|
|
11 * @copyright (c) 2014 Kolab Systems AG
|
|
12 *
|
|
13 **/
|
|
14
|
|
15 CREATE TABLE calendars (
|
|
16 calendar_id integer NOT NULL PRIMARY KEY,
|
|
17 user_id integer NOT NULL default '0',
|
|
18 name varchar(255) NOT NULL default '',
|
|
19 color varchar(255) NOT NULL default '',
|
|
20 showalarms tinyint(1) NOT NULL default '1',
|
|
21 CONSTRAINT fk_calendars_user_id FOREIGN KEY (user_id)
|
|
22 REFERENCES users(user_id)
|
|
23 );
|
|
24
|
|
25 CREATE TABLE events (
|
|
26 event_id integer NOT NULL PRIMARY KEY,
|
|
27 calendar_id integer NOT NULL default '0',
|
|
28 recurrence_id integer NOT NULL default '0',
|
|
29 uid varchar(255) NOT NULL default '',
|
|
30 instance varchar(16) NOT NULL default '',
|
|
31 isexception tinyint(1) NOT NULL default '0',
|
|
32 created datetime NOT NULL default '1000-01-01 00:00:00',
|
|
33 changed datetime NOT NULL default '1000-01-01 00:00:00',
|
|
34 sequence integer NOT NULL default '0',
|
|
35 start datetime NOT NULL default '1000-01-01 00:00:00',
|
|
36 end datetime NOT NULL default '1000-01-01 00:00:00',
|
|
37 recurrence varchar(255) default NULL,
|
|
38 title varchar(255) NOT NULL,
|
|
39 description text NOT NULL,
|
|
40 location varchar(255) NOT NULL default '',
|
|
41 categories varchar(255) NOT NULL default '',
|
|
42 url varchar(255) NOT NULL default '',
|
|
43 all_day tinyint(1) NOT NULL default '0',
|
|
44 free_busy tinyint(1) NOT NULL default '0',
|
|
45 priority tinyint(1) NOT NULL default '0',
|
|
46 sensitivity tinyint(1) NOT NULL default '0',
|
|
47 status varchar(32) NOT NULL default '',
|
|
48 alarms text default NULL,
|
|
49 attendees text default NULL,
|
|
50 notifyat datetime default NULL,
|
|
51 CONSTRAINT fk_events_calendar_id FOREIGN KEY (calendar_id)
|
|
52 REFERENCES calendars(calendar_id)
|
|
53 );
|
|
54
|
|
55 CREATE TABLE attachments (
|
|
56 attachment_id integer NOT NULL PRIMARY KEY,
|
|
57 event_id integer NOT NULL default '0',
|
|
58 filename varchar(255) NOT NULL default '',
|
|
59 mimetype varchar(255) NOT NULL default '',
|
|
60 size integer NOT NULL default '0',
|
|
61 data text NOT NULL default '',
|
|
62 CONSTRAINT fk_attachment_event_id FOREIGN KEY (event_id)
|
|
63 REFERENCES events(event_id)
|
|
64 );
|
|
65
|
|
66 CREATE TABLE itipinvitations (
|
|
67 token varchar(64) NOT NULL PRIMARY KEY,
|
|
68 event_uid varchar(255) NOT NULL,
|
|
69 user_id integer NOT NULL default '0',
|
|
70 event text NOT NULL,
|
|
71 expires datetime NOT NULL default '1000-01-01 00:00:00',
|
|
72 cancelled tinyint(1) NOT NULL default '0',
|
|
73 CONSTRAINT fk_itipinvitations_user_id FOREIGN KEY (user_id)
|
|
74 REFERENCES users(user_id)
|
|
75 );
|
|
76
|
|
77 CREATE INDEX ix_itipinvitations_uid ON itipinvitations(user_id, event_uid);
|
|
78
|
|
79 INSERT INTO system (name, value) VALUES ('calendar-database-version', '2015022700');
|