-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_struktura.sql
40 lines (33 loc) · 1.53 KB
/
db_struktura.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
-- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `locations`;
CREATE TABLE `locations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`city` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`street_name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`street_number` int(10) unsigned DEFAULT NULL,
`zip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`country` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`name` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`latitude` double(8,2) DEFAULT NULL,
`longitude` double(8,2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `persons`;
CREATE TABLE `persons` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`nickname` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`id_location` int(10) unsigned DEFAULT NULL,
`birth_day` date DEFAULT NULL,
`height` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `persons_nickname_first_name_last_name_unique` (`nickname`,`first_name`,`last_name`),
KEY `persons_id_location_foreign` (`id_location`),
CONSTRAINT `persons_id_location_foreign` FOREIGN KEY (`id_location`) REFERENCES `locations` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- 2017-02-27 09:09:00