annotate plugins/calendar/drivers/database/SQL/mysql.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
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
3 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
4 * Plugin to add a calendar to Roundcube.
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
5 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
6 * @author Lazlo Westerhof
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
7 * @author Thomas Bruederli
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
8 * @licence GNU AGPL
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
9 * @copyright (c) 2010 Lazlo Westerhof - Netherlands
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
10 * @copyright (c) 2014 Kolab Systems AG
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
11 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
12 **/
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
13
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
14 CREATE TABLE IF NOT EXISTS `calendars` (
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
15 `calendar_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
16 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
17 `name` varchar(255) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
18 `color` varchar(8) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
19 `showalarms` tinyint(1) NOT NULL DEFAULT '1',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
20 PRIMARY KEY(`calendar_id`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
21 INDEX `user_name_idx` (`user_id`, `name`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
22 CONSTRAINT `fk_calendars_user_id` FOREIGN KEY (`user_id`)
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 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
25
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
26 CREATE TABLE IF NOT EXISTS `events` (
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
27 `event_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
28 `calendar_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
29 `recurrence_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
30 `uid` varchar(255) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
31 `instance` varchar(16) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
32 `isexception` tinyint(1) NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
33 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
34 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
35 `sequence` int(1) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
36 `start` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
37 `end` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
38 `recurrence` varchar(255) DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
39 `title` varchar(255) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
40 `description` text NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
41 `location` varchar(255) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
42 `categories` varchar(255) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
43 `url` varchar(255) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
44 `all_day` tinyint(1) NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
45 `free_busy` tinyint(1) NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
46 `priority` tinyint(1) NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
47 `sensitivity` tinyint(1) NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
48 `status` varchar(32) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
49 `alarms` text DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
50 `attendees` text DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
51 `notifyat` datetime DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
52 PRIMARY KEY(`event_id`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
53 INDEX `uid_idx` (`uid`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
54 INDEX `recurrence_idx` (`recurrence_id`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
55 INDEX `calendar_notify_idx` (`calendar_id`,`notifyat`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
56 CONSTRAINT `fk_events_calendar_id` FOREIGN KEY (`calendar_id`)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
57 REFERENCES `calendars`(`calendar_id`) ON DELETE CASCADE ON UPDATE CASCADE
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
58 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
59
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
60 CREATE TABLE IF NOT EXISTS `attachments` (
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
61 `attachment_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
62 `event_id` int(11) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
63 `filename` varchar(255) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
64 `mimetype` varchar(255) NOT NULL DEFAULT '',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
65 `size` int(11) NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
66 `data` longtext NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
67 PRIMARY KEY(`attachment_id`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
68 CONSTRAINT `fk_attachments_event_id` FOREIGN KEY (`event_id`)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
69 REFERENCES `events`(`event_id`) ON DELETE CASCADE ON UPDATE CASCADE
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
70 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
71
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
72 CREATE TABLE IF NOT EXISTS `itipinvitations` (
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
73 `token` VARCHAR(64) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
74 `event_uid` VARCHAR(255) NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
75 `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
76 `event` TEXT NOT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
77 `expires` DATETIME DEFAULT NULL,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
78 `cancelled` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
79 PRIMARY KEY(`token`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
80 INDEX `uid_idx` (`user_id`,`event_uid`),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
81 CONSTRAINT `fk_itipinvitations_user_id` FOREIGN KEY (`user_id`)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
82 REFERENCES `users`(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
83 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
84
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
85 REPLACE INTO system (name, value) VALUES ('calendar-database-version', '2015022700');