Geoffrey Frogeye
7937496882
While I'm automating this you'll need to download the A set from https://opendata.rapid7.com/sonar.fdns_v2/ to the file a.json.gz.
23 lines
803 B
SQL
23 lines
803 B
SQL
-- Remember to increment DB_VERSION
|
|
-- in database.py on changes to this file
|
|
|
|
CREATE TABLE blocking (
|
|
key text PRIMARY KEY, -- Contains the reversed domain name or IP in binary form
|
|
source TEXT, -- The rule this one is based on
|
|
type INTEGER, -- Type of the field: 1: AS, 2: domain tree, 3: domain, 4: IPv4 network, 6: IPv6 network
|
|
updated INTEGER, -- If the row was updated during last data import (0: No, 1: Yes)
|
|
firstparty INTEGER, -- Which blocking list this row is issued from (0: first-party, 1: multi-party)
|
|
FOREIGN KEY (source) REFERENCES blocking(key) ON DELETE CASCADE
|
|
);
|
|
CREATE INDEX "blocking_type_updated_key" ON "blocking" (
|
|
"type",
|
|
"updated",
|
|
"key" DESC
|
|
);
|
|
|
|
-- Store various things
|
|
CREATE TABLE meta (
|
|
key text PRIMARY KEY,
|
|
value integer
|
|
);
|