-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupDB.sql
More file actions
30 lines (23 loc) · 889 Bytes
/
setupDB.sql
File metadata and controls
30 lines (23 loc) · 889 Bytes
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
CREATE TABLE `incidents` (
`id` int(11) UNSIGNED NOT NULL,
`message` text NOT NULL,
`update_time` timestamp NOT NULL DEFAULT current_timestamp(),
`type` varchar(20) NOT NULL,
`is_automatic` tinyint(1) NOT NULL DEFAULT 0,
`incident_group` smallint(5) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `responses` (
`id` int(11) UNSIGNED NOT NULL,
`req_type` tinyint(3) UNSIGNED NOT NULL,
`res_time` mediumint(8) UNSIGNED NOT NULL,
`res_result` tinyint(1) NOT NULL,
`res_timestamp` bigint(20) UNSIGNED NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
ALTER TABLE `incidents`
ADD PRIMARY KEY (`id`);
ALTER TABLE `responses`
ADD PRIMARY KEY (`id`);
ALTER TABLE `incidents`
MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE `responses`
MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;