-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.sql
More file actions
64 lines (54 loc) · 1.73 KB
/
events.sql
File metadata and controls
64 lines (54 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--
-- Table structure for table `events`
--
CREATE TABLE IF NOT EXISTS `events` (
`id` int(1) NOT NULL AUTO_INCREMENT,
`starts_on` date DEFAULT NULL,
`ends_on` date DEFAULT NULL,
`starts_at` datetime DEFAULT NULL,
`ends_at` datetime DEFAULT NULL,
`frequency` enum('once','daily','weekly','monthly','yearly') NOT NULL,
`separation` tinyint(1) unsigned NOT NULL DEFAULT '1',
`count` tinyint(1) DEFAULT NULL,
`until` date DEFAULT NULL,
`timezone_name` varchar(255) NOT NULL DEFAULT 'Etc/UTC',
`status` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `event_cancellations`
--
CREATE TABLE IF NOT EXISTS `event_cancellations` (
`id` int(1) NOT NULL AUTO_INCREMENT,
`event_id` int(1) NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`id`),
KEY `event_id` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `event_recurrences`
--
CREATE TABLE IF NOT EXISTS `event_recurrences` (
`id` int(1) NOT NULL AUTO_INCREMENT,
`event_id` int(1) NOT NULL,
`day` tinyint(1) NOT NULL,
`week` tinyint(1) DEFAULT NULL,
`month` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_id` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `event_cancellations`
--
ALTER TABLE `event_cancellations`
ADD CONSTRAINT `FK_event_id3` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`);
--
-- Constraints for table `event_recurrences`
--
ALTER TABLE `event_recurrences`
ADD CONSTRAINT `FK_event_id2` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`);