-
Notifications
You must be signed in to change notification settings - Fork 0
/
tables.sql
44 lines (40 loc) · 960 Bytes
/
tables.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
-- name: create-blacklist
BEGIN;
CREATE TABLE IF NOT EXISTS blacklist (
IPAddress TEXT NOT NULL,
EntryDate TEXT NOT NULL,
LastSeen TEXT NOT NULL,
Reason TEXT NOT NULL,
LogicalDelete INT NOT NULL
);
CREATE INDEX IF NOT EXISTS blacklist_1 ON blacklist (LogicalDelete, IPAddress);
COMMIT;
-- name: create-whitelist
BEGIN;
CREATE TABLE IF NOT EXISTS whitelist (
IPAddress TEXT NOT NULL,
EntryDate TEXT NOT NULL,
Reason TEXT NOT NULL,
LogicalDelete INT NOT NULL
);
CREATE INDEX IF NOT EXISTS whitelist_1 ON whitelist (LogicalDelete, IPAddress);
COMMIT;
-- name: create-rules
BEGIN;
CREATE TABLE IF NOT EXISTS rules (
RuleNum INT NOT NULL,
Zone TEXT NOT NULL,
FromIP TEXT NOT NULL,
FromPort TEXT NOT NULL,
ToIP TEXT NOT NULL,
ToPort TEXT NOT NULL
);
COMMIT;
-- name: create-opts
BEGIN;
CREATE TABLE IF NOT EXISTS ruleopts (
Inbound TEXT NOT NULL,
Outbound TEXT NOT NULL
);
INSERT INTO ruleopts VALUES ("allow", "deny");
COMMIT;