forked from bogeblad/infoglue-calendarOld
/
schema.sql
191 lines (161 loc) · 4.59 KB
/
schema.sql
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# EMS MySQL Manager 1.9.6.5
# ---------------------------------------
# Host : localhost
# Port : 3306
# Database : calendar
CREATE DATABASE calendar;
USE calendar;
#
# Structure for table calendar :
#
CREATE TABLE `calendar` (
`id` bigint(20) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`description` varchar(255) default NULL,
`owner` varchar(255) default NULL,
`eventtype_id` bigint(20),
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM;
CREATE TABLE `calendar_group` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`calendar_id` bigint(20) unsigned NOT NULL default '0',
`groupName` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
CREATE TABLE `calendar`.`calendar_role` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`calendar_id` BIGINT UNSIGNED NOT NULL,
`roleName` VARCHAR(255) NOT NULL,
PRIMARY KEY(`id`)
)
ENGINE = MYISAM;
DROP TABLE IF EXISTS event_calendar;
CREATE TABLE event_calendar (
event_id bigint(20) NOT NULL default '0',
calendar_id bigint(20) NOT NULL default '0',
PRIMARY KEY (event_id,calendar_id)
)
#
# Structure for table category :
#
CREATE TABLE `category` (
`id` bigint(20) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`description` varchar(255) default NULL,
`active` TINYINT(4) NOT NULL default '1',
`parent_id` INTEGER(11),
PRIMARY KEY (`id`)
) TYPE=MyISAM;
#
# Structure for table entry :
#
CREATE TABLE `entry` (
`id` bigint(20) NOT NULL auto_increment,
`firstName` varchar(255) default NULL,
`lastName` varchar(255) default NULL,
`email` varchar(255) default NULL,
`event_id` bigint(20) default NULL,
PRIMARY KEY (`id`),
KEY `FK40018521093C0E0` (`event_id`)
) TYPE=MyISAM;
#
# Structure for table event :
#
CREATE TABLE event (
id int NOT NULL ,
name varchar(255) default NULL,
description varchar(255) default NULL,
endDateTime date default NULL,
startDateTime date default NULL,
lecturer varchar(1024) default NULL,
isOrganizedByGU int default NULL,
lastRegistrationDateTime date default NULL,
longDescription text NULL,
maximumParticipants int default NULL,
contactEmail varchar(255) default NULL,
shortDescription text NULL,
organizerName varchar(255) default NULL,
contactPhone varchar(255) default NULL,
price float default NULL,
customLocation varchar(255) default NULL,
isInternal int default NULL,
eventUrl varchar(255) default NULL,
contactName varchar(255) default NULL,
stateId int default NULL,
creator varchar(255) NULL,
calendar_id int default NULL,
PRIMARY KEY (id)
);
#
# Structure for table event_category :
#
CREATE TABLE `event_category` (
`id` bigint(20) NOT NULL auto_increment,
`event_id` bigint(20) NOT NULL default '0',
`category_id` bigint(20) NOT NULL default '0',
`eventtype_categoryattribute_id` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
#
# Structure for table event_location :
#
CREATE TABLE `event_location` (
`event_id` bigint(20) NOT NULL default '0',
`location_id` bigint(20) NOT NULL default '0',
PRIMARY KEY (`event_id`,`location_id`),
KEY `FK5DDBFA20EBB9E5` (`location_id`),
KEY `FK5DDBFA1093C0E0` (`event_id`)
) TYPE=MyISAM;
#
# Structure for table location :
#
CREATE TABLE `location` (
`id` bigint(20) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`description` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM;
#
# Structure for table eventtype :
#
CREATE TABLE `eventtype` (
`id` bigint(20) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`description` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) TYPE=MyISAM;
#
# Structure for table eventtype_category :
#
CREATE TABLE `eventtype_category` (
`id` bigint(20) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`eventtype_id` bigint(20) NOT NULL default '0',
`category_id` bigint(20) NOT NULL default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
#
# Structure for table participant :
#
CREATE TABLE `participant` (
`id` bigint(20) NOT NULL auto_increment,
`userName` varchar(255) default NULL,
`event_id` bigint(20) default NULL,
PRIMARY KEY (`id`),
KEY `FK912797131093C0E0` (`event_id`)
) TYPE=MyISAM;
#
# Structure for table resource :
#
CREATE TABLE `asset` (
`id` bigint(20) NOT NULL auto_increment,
`fileName` varchar(255) default NULL,
`assetKey` varchar(255) default NULL,
`assetBlob` blob NOT NULL,
`event_id` bigint(20) default NULL,
PRIMARY KEY (`id`),
KEY `FKEF86282E1093C0E0` (`event_id`)
) TYPE=MyISAM;