This repository has been archived by the owner on Oct 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
army.sql
74 lines (59 loc) · 2.22 KB
/
army.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
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `person` (
`id` bigint(20) unsigned NOT NULL,
`position_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(256) NOT NULL,
`rank` varchar(128) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`birthday` date DEFAULT NULL,
`photo` varchar(128) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `phone` (
`id` bigint(20) unsigned NOT NULL,
`person_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`number` varchar(255) DEFAULT NULL,
`_order` bigint(20) NOT NULL DEFAULT '0'
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `place` (
`id` bigint(20) unsigned NOT NULL,
`place_id` bigint(20) unsigned DEFAULT '0',
`name` varchar(255) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`level` int(5) DEFAULT NULL,
`_order` bigint(20) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `position` (
`id` bigint(20) unsigned NOT NULL,
`place_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`rank` varchar(128) DEFAULT NULL,
`level` int(5) DEFAULT NULL,
`_order` bigint(20) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `user` (
`id` bigint(20) unsigned NOT NULL,
`login` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
ALTER TABLE `person`
ADD PRIMARY KEY (`id`);
ALTER TABLE `phone`
ADD PRIMARY KEY (`id`);
ALTER TABLE `place`
ADD PRIMARY KEY (`id`);
ALTER TABLE `position`
ADD PRIMARY KEY (`id`);
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
ALTER TABLE `person`
MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14;
ALTER TABLE `phone`
MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=16;
ALTER TABLE `place`
MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
ALTER TABLE `position`
MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=32;
ALTER TABLE `user`
MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;