2019-09-17 09:34:16 +02:00
|
|
|
/*Table for keeping the plug scanner registration*/
|
|
|
|
CREATE TABLE scanner_registration
|
|
|
|
(
|
|
|
|
id SERIAL PRIMARY KEY NOT NULL,
|
|
|
|
uuid VARCHAR(64) UNIQUE NOT NULL,
|
|
|
|
url VARCHAR(256) UNIQUE NOT NULL,
|
|
|
|
name VARCHAR(128) UNIQUE NOT NULL,
|
|
|
|
description VARCHAR(1024) NULL,
|
|
|
|
auth VARCHAR(16) NOT NULL,
|
|
|
|
access_cred VARCHAR(512) NULL,
|
|
|
|
disabled BOOLEAN NOT NULL DEFAULT FALSE,
|
|
|
|
is_default BOOLEAN NOT NULL DEFAULT FALSE,
|
|
|
|
skip_cert_verify BOOLEAN NOT NULL DEFAULT FALSE,
|
|
|
|
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
update_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
|
|
);
|
|
|
|
|
2019-09-19 13:15:37 +02:00
|
|
|
/*Table for keeping the scan report. The report details are stored as JSON*/
|
|
|
|
CREATE TABLE scan_report
|
2019-09-17 09:34:16 +02:00
|
|
|
(
|
|
|
|
id SERIAL PRIMARY KEY NOT NULL,
|
2019-09-23 10:03:42 +02:00
|
|
|
uuid VARCHAR(64) UNIQUE NOT NULL,
|
2019-09-17 09:34:16 +02:00
|
|
|
digest VARCHAR(256) NOT NULL,
|
2019-09-19 13:15:37 +02:00
|
|
|
registration_uuid VARCHAR(64) NOT NULL,
|
|
|
|
mime_type VARCHAR(256) NOT NULL,
|
2019-09-17 09:34:16 +02:00
|
|
|
job_id VARCHAR(32),
|
|
|
|
status VARCHAR(16) NOT NULL,
|
|
|
|
status_code INTEGER DEFAULT 0,
|
2019-09-23 10:03:42 +02:00
|
|
|
status_rev BIGINT DEFAULT 0,
|
2019-09-17 09:34:16 +02:00
|
|
|
report JSON,
|
|
|
|
start_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
end_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
2019-09-19 13:15:37 +02:00
|
|
|
UNIQUE(digest, registration_uuid, mime_type)
|
2019-09-17 09:34:16 +02:00
|
|
|
)
|