· 8 years ago · May 20, 2018, 04:50 PM
1-- --------------------------------------------------------
2-- Host: 192.168.1.10
3-- Versione server: 5.7.22-0ubuntu18.04.1 - (Ubuntu)
4-- S.O. server: Linux
5-- HeidiSQL Versione: 9.4.0.5125
6-- --------------------------------------------------------
7
8/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
9/*!40101 SET NAMES utf8 */;
10/*!50503 SET NAMES utf8mb4 */;
11/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
12/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
13
14
15-- Dump della struttura del database exampleapp
16CREATE DATABASE IF NOT EXISTS `exampleapp` /*!40100 DEFAULT CHARACTER SET latin1 */;
17USE `exampleapp`;
18
19-- Dump della struttura di tabella exampleapp.activations
20CREATE TABLE IF NOT EXISTS `activations` (
21 `code` char(40) NOT NULL,
22 `activated` tinyint(1) NOT NULL DEFAULT '0',
23 PRIMARY KEY (`code`)
24) ENGINE=InnoDB DEFAULT CHARSET=latin1;
25
26-- Dump dei dati della tabella exampleapp.activations: ~8 rows (circa)
27/*!40000 ALTER TABLE `activations` DISABLE KEYS */;
28INSERT INTO `activations` (`code`, `activated`) VALUES
29 ('4f85237212373e0914f1df11fc391165ef11d423', 0),
30 ('67090c0676183ee5cc9447639eb383ecc981bf9d', 0),
31 ('89b29ed7bb8689705630676737c19fdcf40505e6', 0),
32 ('9582fb861492a91ff2eda22f5d0dc8a8967087e4', 0),
33 ('a92bc4710a892a670aebb36db4b4451e10acc05f', 0),
34 ('d49f1f1cf0ae2b5e727e26d4acb8a938b02c3bc6', 0),
35 ('df834442ea6dccedd99bef721f57c31c19bf9568', 0),
36 ('e29b49536d378e131cfb7203b02d1d4af1975e7d', 0),
37 ('f32f4c8403b881975606be446483263a3e688cc4', 0);
38/*!40000 ALTER TABLE `activations` ENABLE KEYS */;
39
40-- Dump della struttura di tabella exampleapp.admins
41CREATE TABLE IF NOT EXISTS `admins` (
42 `id` int(11) NOT NULL AUTO_INCREMENT,
43 `user_id` int(11) NOT NULL,
44 `company_id` int(11) NOT NULL,
45 `superadmin` tinyint(1) NOT NULL,
46 PRIMARY KEY (`id`),
47 UNIQUE KEY `user_company_index` (`user_id`,`company_id`)
48) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
49
50-- Dump dei dati della tabella exampleapp.admins: ~3 rows (circa)
51/*!40000 ALTER TABLE `admins` DISABLE KEYS */;
52INSERT INTO `admins` (`id`, `user_id`, `company_id`, `superadmin`) VALUES
53 (1, 1, 1, 1),
54 (2, 2, 1, 1),
55 (3, 3, 1, 0);
56/*!40000 ALTER TABLE `admins` ENABLE KEYS */;
57
58-- Dump della struttura di tabella exampleapp.athletes
59CREATE TABLE IF NOT EXISTS `athletes` (
60 `id` int(11) NOT NULL AUTO_INCREMENT,
61 `user_id` int(11) NOT NULL DEFAULT '0',
62 `company_id` int(11) NOT NULL,
63 PRIMARY KEY (`id`),
64 UNIQUE KEY `user_company_index` (`user_id`,`company_id`)
65) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1;
66
67-- Dump dei dati della tabella exampleapp.athletes: ~8 rows (circa)
68/*!40000 ALTER TABLE `athletes` DISABLE KEYS */;
69INSERT INTO `athletes` (`id`, `user_id`, `company_id`) VALUES
70 (1, 2, 1),
71 (4, 4, 1),
72 (13, 5, 1),
73 (15, 7, 1),
74 (16, 8, 1),
75 (17, 9, 1),
76 (18, 10, 1),
77 (19, 11, 1),
78 (2, 15, 1),
79 (3, 16, 1);
80/*!40000 ALTER TABLE `athletes` ENABLE KEYS */;
81
82-- Dump della struttura di tabella exampleapp.coaches
83CREATE TABLE IF NOT EXISTS `coaches` (
84 `id` int(11) NOT NULL AUTO_INCREMENT,
85 `user_id` int(11) DEFAULT NULL,
86 `company_id` int(11) DEFAULT NULL,
87 PRIMARY KEY (`id`),
88 UNIQUE KEY `coach_company_index` (`user_id`,`company_id`)
89) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
90
91-- Dump dei dati della tabella exampleapp.coaches: ~3 rows (circa)
92/*!40000 ALTER TABLE `coaches` DISABLE KEYS */;
93INSERT INTO `coaches` (`id`, `user_id`, `company_id`) VALUES
94 (1, 3, 1),
95 (4, 5, 1),
96 (3, 10, 1);
97/*!40000 ALTER TABLE `coaches` ENABLE KEYS */;
98
99-- Dump della struttura di tabella exampleapp.companies
100CREATE TABLE IF NOT EXISTS `companies` (
101 `id` int(11) NOT NULL AUTO_INCREMENT,
102 `name` varchar(50) NOT NULL DEFAULT '0',
103 PRIMARY KEY (`id`)
104) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
105
106-- Dump dei dati della tabella exampleapp.companies: ~2 rows (circa)
107/*!40000 ALTER TABLE `companies` DISABLE KEYS */;
108INSERT INTO `companies` (`id`, `name`) VALUES
109 (1, 'Dinamo Sassari'),
110 (2, 'Olimpia Milano');
111/*!40000 ALTER TABLE `companies` ENABLE KEYS */;
112
113-- Dump della struttura di tabella exampleapp.components
114CREATE TABLE IF NOT EXISTS `components` (
115 `id` int(11) NOT NULL AUTO_INCREMENT,
116 `component` varchar(255) NOT NULL,
117 PRIMARY KEY (`id`)
118) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
119
120-- Dump dei dati della tabella exampleapp.components: ~2 rows (circa)
121/*!40000 ALTER TABLE `components` DISABLE KEYS */;
122INSERT INTO `components` (`id`, `component`) VALUES
123 (1, 'website'),
124 (2, 'mobile app');
125/*!40000 ALTER TABLE `components` ENABLE KEYS */;
126
127-- Dump della struttura di tabella exampleapp.events
128CREATE TABLE IF NOT EXISTS `events` (
129 `id` int(11) NOT NULL AUTO_INCREMENT,
130 `name` varchar(30) DEFAULT NULL,
131 `event_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
132 `team_id` int(11) DEFAULT NULL,
133 `event_type_id` int(11) DEFAULT NULL,
134 `location` varchar(50) DEFAULT NULL,
135 `note` varchar(200) DEFAULT NULL,
136 PRIMARY KEY (`id`),
137 UNIQUE KEY `name_date_team` (`name`,`event_date`,`team_id`)
138) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
139
140-- Dump dei dati della tabella exampleapp.events: ~4 rows (circa)
141/*!40000 ALTER TABLE `events` DISABLE KEYS */;
142INSERT INTO `events` (`id`, `name`, `event_date`, `team_id`, `event_type_id`, `location`, `note`) VALUES
143 (1, 'event01', '2018-02-02 20:00:00', 2, 1, NULL, NULL),
144 (3, 'evento02', '2018-02-03 19:50:00', 2, 1, NULL, NULL),
145 (4, 'evento03', '2018-02-04 21:00:00', 2, 1, NULL, NULL),
146 (5, 'evento04', '2018-02-05 18:30:00', 2, 1, NULL, NULL);
147/*!40000 ALTER TABLE `events` ENABLE KEYS */;
148
149-- Dump della struttura di tabella exampleapp.events_athletes
150CREATE TABLE IF NOT EXISTS `events_athletes` (
151 `event_id` int(11) NOT NULL,
152 `athlete_id` int(11) NOT NULL,
153 PRIMARY KEY (`event_id`,`athlete_id`)
154) ENGINE=InnoDB DEFAULT CHARSET=latin1;
155
156-- Dump dei dati della tabella exampleapp.events_athletes: ~2 rows (circa)
157/*!40000 ALTER TABLE `events_athletes` DISABLE KEYS */;
158INSERT INTO `events_athletes` (`event_id`, `athlete_id`) VALUES
159 (1, 4),
160 (1, 13);
161/*!40000 ALTER TABLE `events_athletes` ENABLE KEYS */;
162
163-- Dump della struttura di tabella exampleapp.event_types
164CREATE TABLE IF NOT EXISTS `event_types` (
165 `id` int(11) NOT NULL AUTO_INCREMENT,
166 `type` varchar(10) DEFAULT NULL,
167 PRIMARY KEY (`id`)
168) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
169
170-- Dump dei dati della tabella exampleapp.event_types: ~3 rows (circa)
171/*!40000 ALTER TABLE `event_types` DISABLE KEYS */;
172INSERT INTO `event_types` (`id`, `type`) VALUES
173 (1, 'training'),
174 (2, 'match');
175/*!40000 ALTER TABLE `event_types` ENABLE KEYS */;
176
177-- Dump della struttura di tabella exampleapp.phinxlog
178CREATE TABLE IF NOT EXISTS `phinxlog` (
179 `version` bigint(20) NOT NULL,
180 `migration_name` varchar(100) DEFAULT NULL,
181 `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
182 `end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
183 PRIMARY KEY (`version`)
184) ENGINE=InnoDB DEFAULT CHARSET=utf8;
185
186-- Dump dei dati della tabella exampleapp.phinxlog: ~0 rows (circa)
187/*!40000 ALTER TABLE `phinxlog` DISABLE KEYS */;
188INSERT INTO `phinxlog` (`version`, `migration_name`, `start_time`, `end_time`) VALUES
189 (20160111202556, 'TicketsTable', '2018-02-18 20:03:45', '2018-02-18 20:03:46');
190/*!40000 ALTER TABLE `phinxlog` ENABLE KEYS */;
191
192-- Dump della struttura di tabella exampleapp.seasons
193CREATE TABLE IF NOT EXISTS `seasons` (
194 `id` int(11) NOT NULL AUTO_INCREMENT,
195 `name` varchar(20) NOT NULL,
196 `company_id` int(11) NOT NULL,
197 PRIMARY KEY (`id`),
198 UNIQUE KEY `season_company` (`name`,`company_id`)
199) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
200
201-- Dump dei dati della tabella exampleapp.seasons: ~6 rows (circa)
202/*!40000 ALTER TABLE `seasons` DISABLE KEYS */;
203INSERT INTO `seasons` (`id`, `name`, `company_id`) VALUES
204 (8, '20142015', 1),
205 (4, '20152016', 1),
206 (7, '20152016', 2),
207 (1, '20162017', 1),
208 (2, '20172018', 1),
209 (3, '20172018', 2);
210/*!40000 ALTER TABLE `seasons` ENABLE KEYS */;
211
212-- Dump della struttura di tabella exampleapp.teams
213CREATE TABLE IF NOT EXISTS `teams` (
214 `id` int(11) NOT NULL AUTO_INCREMENT,
215 `name` varchar(50) NOT NULL DEFAULT '0',
216 `company_id` int(11) NOT NULL DEFAULT '0',
217 `season_id` int(11) NOT NULL DEFAULT '0',
218 PRIMARY KEY (`id`),
219 UNIQUE KEY `name_company_season` (`name`,`company_id`,`season_id`),
220 KEY `company_id` (`company_id`),
221 KEY `season_id` (`season_id`)
222) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
223
224-- Dump dei dati della tabella exampleapp.teams: ~5 rows (circa)
225/*!40000 ALTER TABLE `teams` DISABLE KEYS */;
226INSERT INTO `teams` (`id`, `name`, `company_id`, `season_id`) VALUES
227 (6, 'Baratheon', 1, 1),
228 (4, 'Baratheon', 1, 2),
229 (3, 'Bolton', 2, 2),
230 (2, 'Lannister', 1, 2),
231 (1, 'Stark', 1, 2);
232/*!40000 ALTER TABLE `teams` ENABLE KEYS */;
233
234-- Dump della struttura di tabella exampleapp.teams_athletes
235CREATE TABLE IF NOT EXISTS `teams_athletes` (
236 `team_id` int(11) NOT NULL,
237 `athlete_id` int(11) NOT NULL,
238 PRIMARY KEY (`team_id`,`athlete_id`)
239) ENGINE=InnoDB DEFAULT CHARSET=latin1;
240
241-- Dump dei dati della tabella exampleapp.teams_athletes: ~7 rows (circa)
242/*!40000 ALTER TABLE `teams_athletes` DISABLE KEYS */;
243INSERT INTO `teams_athletes` (`team_id`, `athlete_id`) VALUES
244 (1, 4),
245 (1, 13),
246 (1, 15),
247 (1, 16),
248 (2, 4),
249 (4, 1),
250 (6, 19);
251/*!40000 ALTER TABLE `teams_athletes` ENABLE KEYS */;
252
253-- Dump della struttura di tabella exampleapp.teams_coaches
254CREATE TABLE IF NOT EXISTS `teams_coaches` (
255 `team_id` int(11) NOT NULL,
256 `coach_id` int(11) NOT NULL,
257 PRIMARY KEY (`team_id`,`coach_id`)
258) ENGINE=InnoDB DEFAULT CHARSET=latin1;
259
260-- Dump dei dati della tabella exampleapp.teams_coaches: ~2 rows (circa)
261/*!40000 ALTER TABLE `teams_coaches` DISABLE KEYS */;
262INSERT INTO `teams_coaches` (`team_id`, `coach_id`) VALUES
263 (2, 4),
264 (4, 3);
265/*!40000 ALTER TABLE `teams_coaches` ENABLE KEYS */;
266
267-- Dump della struttura di tabella exampleapp.tickets
268CREATE TABLE IF NOT EXISTS `tickets` (
269 `id` int(11) NOT NULL AUTO_INCREMENT,
270 `title` varchar(255) NOT NULL,
271 `description` text NOT NULL,
272 `component_id` int(11) NOT NULL,
273 PRIMARY KEY (`id`),
274 KEY `component_id` (`component_id`),
275 CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`)
276) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
277
278-- Dump dei dati della tabella exampleapp.tickets: ~0 rows (circa)
279/*!40000 ALTER TABLE `tickets` DISABLE KEYS */;
280INSERT INTO `tickets` (`id`, `title`, `description`, `component_id`) VALUES
281 (1, 'test_ticket', 'test_ticket_description', 1);
282/*!40000 ALTER TABLE `tickets` ENABLE KEYS */;
283
284-- Dump della struttura di tabella exampleapp.users
285CREATE TABLE IF NOT EXISTS `users` (
286 `id` int(11) NOT NULL AUTO_INCREMENT,
287 `username` varchar(20) DEFAULT NULL,
288 `password` varchar(20) DEFAULT NULL,
289 `email` varchar(50) NOT NULL,
290 `active` tinyint(1) NOT NULL DEFAULT '0',
291 PRIMARY KEY (`id`),
292 UNIQUE KEY `email` (`email`)
293) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;
294
295-- Dump dei dati della tabella exampleapp.users: ~15 rows (circa)
296/*!40000 ALTER TABLE `users` DISABLE KEYS */;
297INSERT INTO `users` (`id`, `username`, `password`, `email`, `active`) VALUES
298 (1, 'pippo', 'pippo', 'pippo@pippo.it', 1),
299 (2, 'pluto', 'pluto', 'pluto@pluto.it', 1),
300 (3, 'beppe', 'beppe', 'beppe@beppe.it', 1),
301 (4, NULL, NULL, 'sansa@stark.com', 0),
302 (5, 'edstark', 'edstark', 'ed@stark.com', 1),
303 (7, NULL, NULL, 'john@snow.com', 0),
304 (8, NULL, NULL, 'arya@stark.com', 0),
305 (9, NULL, NULL, 'theon@grevjoy.com', 0),
306 (10, NULL, NULL, 'stannis@baratheon.com', 0),
307 (11, NULL, NULL, 'joffrey@baratheon.com', 0),
308 (12, NULL, NULL, 'cersei@lannister.com', 0),
309 (13, NULL, NULL, 'tyrion@lannister.com', 0),
310 (14, NULL, NULL, 'jaimie@lannister.com', 0),
311 (15, NULL, NULL, 'khal@drogo.com', 0),
312 (16, NULL, NULL, 'tommen@baratheon.com', 0),
313 (17, NULL, NULL, 'hugo@reyes.it', 0),
314 (18, NULL, NULL, 'jack@shepard.it', 0);
315/*!40000 ALTER TABLE `users` ENABLE KEYS */;
316
317/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
318/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
319/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;