-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsql_dump.sql
More file actions
42 lines (33 loc) · 1.21 KB
/
sql_dump.sql
File metadata and controls
42 lines (33 loc) · 1.21 KB
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
CREATE DATABASE login_system;
USE login_system;
CREATE TABLE `access_logs` (
`id` int(11) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`access_time` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `blocked_ips` (
`id` int(11) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`blocked_until` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `requests` (
`id` int(11) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`request_time` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `access_logs`
ADD PRIMARY KEY (`id`);
ALTER TABLE `blocked_ips`
ADD PRIMARY KEY (`id`);
ALTER TABLE `requests`
ADD PRIMARY KEY (`id`);
ALTER TABLE `access_logs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `blocked_ips`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `requests`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;