-
Notifications
You must be signed in to change notification settings - Fork 3
/
creates.sql
179 lines (143 loc) · 6.37 KB
/
creates.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
CREATE TABLE IF NOT EXISTS `banned_email_domains` (
`domain` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `comp` (
`comp_id` int(11) NOT NULL AUTO_INCREMENT,
`serial_1` text COLLATE utf8mb4_unicode_ci,
`serial_2` text COLLATE utf8mb4_unicode_ci,
`serial_3` text COLLATE utf8mb4_unicode_ci,
`op_sys` text COLLATE utf8mb4_unicode_ci,
`comp_link` int(11) NOT NULL DEFAULT '0',
`last_active` date DEFAULT NULL,
`comp_ban` tinyint(1) NOT NULL DEFAULT '0',
`comp_ban_date` date DEFAULT NULL,
`comp_ban_date_end` date DEFAULT NULL,
`comp_comments` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`comp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=31931 ;
CREATE TABLE IF NOT EXISTS `compY` (
`comp_id` int(11) NOT NULL AUTO_INCREMENT,
`serial` varchar(32) CHARACTER SET utf8 NOT NULL,
`comp_link` int(11) NOT NULL DEFAULT '0',
`last_active` date DEFAULT NULL,
`comp_ban` tinyint(1) NOT NULL DEFAULT '0',
`comp_ban_date` date DEFAULT NULL,
`comp_ban_date_end` date DEFAULT NULL,
`comp_comments` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`comp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=18061 ;
CREATE TABLE IF NOT EXISTS `comp_user` (
`user_id` int(11) NOT NULL,
`validation_token` varchar(32) CHARACTER SET utf8 NOT NULL,
`trigger_ip` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`delete_after` date DEFAULT NULL,
PRIMARY KEY (`validation_token`),
KEY `fk_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `disable_user` (
`user_id` int(11) NOT NULL,
`validation_token` varchar(32) CHARACTER SET utf8 NOT NULL,
`trigger_ip` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`delete_after` date DEFAULT NULL,
PRIMARY KEY (`validation_token`),
KEY `fk_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `domains_unverified` (
`domain` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `domains_whitelist` (
`domain` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`domain`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `new_user` (
`email` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`username` varchar(31) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`trigger_ip` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`validation_token` varchar(32) CHARACTER SET utf8 NOT NULL,
`delete_after` date DEFAULT NULL,
PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `recover_user` (
`user_id` int(11) NOT NULL,
`validation_token` varchar(32) CHARACTER SET utf8 NOT NULL,
`trigger_ip` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`delete_after` date DEFAULT NULL,
PRIMARY KEY (`validation_token`),
KEY `fk_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `recover_user` (
`user_id` int(11) NOT NULL,
`validation_token` varchar(32) CHARACTER SET utf8 NOT NULL,
`trigger_ip` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`delete_after` date DEFAULT NULL,
PRIMARY KEY (`validation_token`),
KEY `fk_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `statistics` (
`date` date NOT NULL,
`logins` int(11) NOT NULL DEFAULT '0',
`logins_unique` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `team_big_battle` (
`user_id` int(11) NOT NULL,
`user_exp` int(11) NOT NULL,
`user_rank` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `team_slayer` (
`user_id` int(11) NOT NULL,
`user_exp` int(11) NOT NULL,
`user_rank` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(254) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`username` varchar(31) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`login_token` varchar(32) CHARACTER SET utf8 DEFAULT NULL,
`last_login` date DEFAULT NULL,
`last_log` int(11) NOT NULL DEFAULT '0',
`user_ip` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
`user_type` tinyint(1) NOT NULL DEFAULT '1',
`user_ban_date` date DEFAULT NULL,
`user_ban_date_end` date DEFAULT NULL,
`user_comments` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=51349 ;
CREATE TABLE IF NOT EXISTS `user_comp` (
`user_comp_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`comp_id` int(11) NOT NULL,
`user_comp_comments` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`user_comp_id`),
KEY `fk_user_id` (`user_id`),
KEY `fk_comp_id` (`comp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=35064 ;
CREATE TABLE IF NOT EXISTS `user_compY` (
`user_id` int(11) NOT NULL,
`comp_id` int(11) NOT NULL,
`user_comp_comments` text COLLATE utf8mb4_unicode_ci,
KEY `fk_user_id` (`user_id`),
KEY `fk_comp_id` (`comp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS `user_data` (
`user_id` int(11) NOT NULL,
`date_joined` date DEFAULT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE admin_users (
username VARCHAR(50) NOT NULL,
password VARCHAR(100) NOT NULL,
enabled TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY (username)
);
CREATE TABLE admin_authorities (
username VARCHAR(50) NOT NULL,
authority VARCHAR(50) NOT NULL,
FOREIGN KEY (username) REFERENCES admin_users(username)
);
CREATE UNIQUE INDEX ix_auth_username
on admin_authorities (username,authority);