forked from jtojnar/entries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sql
255 lines (247 loc) · 8.52 KB
/
install.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
-- Adminer 4.1.0 MySQL dump
SET NAMES utf8mb4;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `country`;
CREATE TABLE `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`code` char(2) COLLATE utf8mb4_unicode_ci NOT NULL,
`aliases` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL,
`europe` int(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `country` (`id`, `name`, `code`, `aliases`, `europe`) VALUES
(1, 'Afghanistan', 'af', '', 0),
(2, 'Albania', 'al', '', 1),
(3, 'Algeria', 'dz', '', 0),
(4, 'Andorra', 'ad', '', 1),
(5, 'Angola', 'ao', '', 0),
(6, 'Antigua and Barbuda', 'ag', '', 0),
(7, 'Argentina', 'ar', '', 0),
(8, 'Armenia', 'am', '', 1),
(9, 'Australia', 'au', '', 0),
(10, 'Austria', 'at', '', 1),
(11, 'Azerbaijan', 'az', '', 1),
(12, 'Bahamas', 'bs', '', 0),
(13, 'Bahrain', 'bh', '', 0),
(14, 'Bangladesh', 'bd', '', 0),
(15, 'Barbados', 'bb', '', 0),
(16, 'Belarus', 'by', '', 1),
(17, 'Belgium', 'be', '', 1),
(18, 'Belize', 'bz', '', 0),
(19, 'Benin', 'bj', '', 0),
(20, 'Bhutan', 'bt', '', 0),
(21, 'Bolivia', 'bo', '', 0),
(22, 'Bosnia and Herzegovina', 'ba', '', 1),
(23, 'Botswana', 'bw', '', 0),
(24, 'Brazil', 'br', '', 0),
(25, 'Brunei', 'bn', '', 0),
(26, 'Bulgaria', 'bg', '', 1),
(27, 'Burkina Faso', 'bf', '', 0),
(28, 'Burundi', 'bi', '', 0),
(29, 'Cambodia', 'kh', '', 0),
(30, 'Cameroon', 'cm', '', 0),
(31, 'Canada', 'ca', '', 0),
(32, 'Cape Verde', 'cv', '', 0),
(33, 'Central African Republic', 'cf', '', 0),
(34, 'Chad', 'td', '', 0),
(35, 'Chile', 'cl', '', 0),
(36, 'China', 'cn', '', 0),
(37, 'Colombia', 'co', '', 0),
(38, 'Comoros', 'km', '', 0),
(39, 'Congo, Democratic Republic', 'cd', '', 0),
(40, 'Congo, Republic', 'cg', '', 0),
(41, 'Costa Rica', 'cr', '', 0),
(42, 'Ivory Coast', 'ci', '', 0),
(43, 'Croatia', 'hr', '', 1),
(44, 'Cuba', 'cu', '', 0),
(45, 'Cyprus', 'cy', '', 1),
(46, 'Czech Republic', 'cz', '', 1),
(47, 'Denmark', 'dk', '', 1),
(48, 'Djibouti', 'dj', '', 0),
(49, 'Dominica', 'dm', '', 0),
(50, 'Dominican Republic', 'do', '', 0),
(51, 'Ecuador', 'ec', '', 0),
(52, 'Egypt', 'eg', '', 0),
(53, 'El Salvador', 'sv', '', 0),
(54, 'Equatorial Guinea', 'gq', '', 0),
(55, 'Eritrea', 'er', '', 0),
(56, 'Estonia', 'ee', '', 1),
(57, 'Ethiopia', 'et', '', 0),
(58, 'Fiji', 'fj', '', 0),
(59, 'Finland', 'fi', '', 1),
(60, 'France', 'fr', '', 1),
(61, 'Gabon', 'ga', '', 0),
(62, 'Gambia', 'gm', '', 0),
(63, 'Georgia', 'ge', '', 1),
(64, 'Germany', 'de', '', 1),
(65, 'Ghana', 'gh', '', 0),
(66, 'Greece', 'gr', '', 1),
(67, 'Grenada', 'gd', '', 0),
(68, 'Guatemala', 'gt', '', 0),
(69, 'Guinea', 'gn', '', 0),
(70, 'Guinea-Bissau', 'gw', '', 0),
(71, 'Guyana', 'gy', '', 0),
(72, 'Haiti', 'ht', '', 0),
(73, 'Honduras', 'hn', '', 0),
(74, 'Hungary', 'hu', '', 1),
(75, 'Iceland', 'is', '', 1),
(76, 'India', 'in', '', 0),
(77, 'Indonesia', 'id', '', 0),
(78, 'Iran', 'ir', '', 0),
(79, 'Iraq', 'iq', '', 0),
(80, 'Ireland', 'ie', '', 1),
(81, 'Israel', 'il', '', 0),
(82, 'Italy', 'it', '', 1),
(83, 'Jamaica', 'jm', '', 0),
(84, 'Japan', 'jp', '', 0),
(85, 'Jordan', 'jo', '', 0),
(86, 'Kazakhstan', 'kz', '', 1),
(87, 'Kenya', 'ke', '', 0),
(88, 'Kiribati', 'ki', '', 0),
(89, 'Korea (North Korea)', 'kp', '', 0),
(90, 'Korea (South Korea)', 'kr', '', 0),
(91, 'Kuwait', 'kw', '', 0),
(92, 'Kyrgyzstan', 'kg', '', 0),
(93, 'Laos', 'la', '', 0),
(94, 'Latvia', 'lv', '', 1),
(95, 'Lebanon', 'lb', '', 0),
(96, 'Lesotho', 'ls', '', 0),
(97, 'Liberia', 'lr', '', 0),
(98, 'Libya', 'ly', '', 0),
(99, 'Liechtenstein', 'li', '', 1),
(100, 'Lithuania', 'lt', '', 1),
(101, 'Luxembourg', 'lu', '', 1),
(102, 'Macedonia', 'mk', '', 1),
(103, 'Madagascar', 'mg', '', 0),
(104, 'Malawi', 'mw', '', 0),
(105, 'Malaysia', 'my', '', 0),
(106, 'Maldives', 'mv', '', 0),
(107, 'Mali', 'ml', '', 0),
(108, 'Malta', 'mt', '', 1),
(109, 'Marshall Islands', 'mh', '', 0),
(110, 'Mauritania', 'mr', '', 0),
(111, 'Mauritius', 'mu', '', 0),
(112, 'Mexico', 'mx', '', 0),
(113, 'Micronesia', 'fm', '', 0),
(114, 'Moldova', 'md', '', 1),
(115, 'Monaco', 'mc', '', 1),
(116, 'Mongolia', 'mn', '', 0),
(117, 'Montenegro', 'me', '', 1),
(118, 'Morocco', 'ma', '', 0),
(119, 'Mozambique', 'mz', '', 0),
(120, 'Myanmar (Burma)', 'mm', '', 0),
(121, 'Namibia', 'na', '', 0),
(122, 'Nauru', 'nr', '', 0),
(123, 'Nepal', 'np', '', 0),
(124, 'Netherlands', 'nl', '', 1),
(125, 'New Zealand', 'nz', '', 0),
(126, 'Nicaragua', 'ni', '', 0),
(127, 'Niger', 'ne', '', 0),
(128, 'Nigeria', 'ng', '', 0),
(129, 'Norway', 'no', '', 1),
(130, 'Oman', 'om', '', 0),
(131, 'Pakistan', 'pk', '', 0),
(132, 'Palau', 'pw', '', 0),
(133, 'Panama', 'pa', '', 0),
(134, 'Papua New Guinea', 'pg', '', 0),
(135, 'Paraguay', 'py', '', 0),
(136, 'Peru', 'pe', '', 0),
(137, 'Philippines', 'ph', '', 0),
(138, 'Poland', 'pl', '', 1),
(139, 'Portugal', 'pt', '', 1),
(140, 'Qatar', 'qa', '', 0),
(141, 'Romania', 'ro', '', 1),
(142, 'Russia', 'ru', '', 1),
(143, 'Rwanda', 'rw', '', 0),
(144, 'Saint Kitts and Nevis', 'kn', '', 0),
(145, 'Saint Lucia', 'lc', '', 0),
(146, 'Saint Vincent and the Grenadines', 'vc', '', 0),
(147, 'Samoa', 'ws', '', 0),
(148, 'San Marino', 'sm', '', 1),
(149, 'Sao Tome and Principe', 'st', '', 0),
(150, 'Saudi Arabia', 'sa', '', 0),
(151, 'Senegal', 'sn', '', 0),
(152, 'Serbia', 'rs', '', 1),
(153, 'Seychelles', 'sc', '', 0),
(154, 'Sierra Leone', 'sl', '', 0),
(155, 'Singapore', 'sg', '', 0),
(156, 'Slovakia', 'sk', '', 1),
(157, 'Slovenia', 'si', '', 1),
(158, 'Solomon Islands', 'sb', '', 0),
(159, 'Somalia', 'so', '', 0),
(160, 'South Africa', 'za', '', 0),
(161, 'Spain', 'es', '', 1),
(162, 'Sri Lanka', 'lk', '', 0),
(163, 'Sudan', 'sd', '', 0),
(164, 'Suriname', 'sr', '', 0),
(165, 'Swaziland', 'sz', '', 0),
(166, 'Sweden', 'se', '', 1),
(167, 'Switzerland', 'ch', '', 1),
(168, 'Syria', 'sy', '', 0),
(169, 'Tajikistan', 'tj', '', 0),
(170, 'Tanzania', 'tz', '', 0),
(171, 'Thailand', 'th', '', 0),
(172, 'East Timor', 'tl', 'Timor-Leste', 0),
(173, 'Togo', 'tg', '', 0),
(174, 'Tonga', 'to', '', 0),
(175, 'Trinidad and Tobago', 'tt', '', 0),
(176, 'Tunisia', 'tn', '', 0),
(177, 'Turkey', 'tr', '', 0),
(178, 'Turkmenistan', 'tm', '', 0),
(179, 'Tuvalu', 'tv', '', 0),
(180, 'Uganda', 'ug', '', 0),
(181, 'Ukraine', 'ua', '', 1),
(182, 'United Arab Emirates', 'ae', '', 0),
(183, 'United Kingdom', 'gb', '', 1),
(184, 'United States', 'us', '', 0),
(185, 'Uruguay', 'uy', '', 0),
(186, 'Uzbekistan', 'uz', '', 0),
(187, 'Vanuatu', 'vu', '', 0),
(188, 'Vatican City', 'va', '', 1),
(189, 'Venezuela', 've', '', 0),
(190, 'Vietnam', 'vn', '', 0),
(191, 'Yemen', 'ye', '', 0),
(192, 'Zambia', 'zm', '', 0),
(193, 'Zimbabwe', 'zw', '', 0);
DROP TABLE IF EXISTS `person`;
CREATE TABLE `person` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`lastname` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`gender` enum('male','female') COLLATE utf8mb4_unicode_ci NOT NULL,
`birth` date NOT NULL,
`details` text NOT NULL,
`email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`team_id` int(11) NOT NULL,
`contact` tinyint(1) DEFAULT 0 NOT NULL,
PRIMARY KEY (`id`),
KEY `team_id` (`team_id`),
CONSTRAINT `person_ibfk_6` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `team`;
CREATE TABLE `team` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`message` text COLLATE utf8mb4_unicode_ci NOT NULL,
`status` enum('registered','paid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'registered',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`details` text COLLATE utf8mb4_unicode_ci NOT NULL,
`ip` varchar(39) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `invoice`;
CREATE TABLE `invoice` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`team_id` int(11) NOT NULL,
`items` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
KEY `team_id` (`team_id`),
CONSTRAINT `invoice_ibfk_1` FOREIGN KEY (`team_id`) REFERENCES `team` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;