|
|
|
|
@ -1,14 +1,14 @@
|
|
|
|
|
CREATE SCHEMA covscanrest; |
|
|
|
|
CREATE SCHEMA osh; |
|
|
|
|
|
|
|
|
|
GRANT USAGE ON SCHEMA covscanrest TO postgres; |
|
|
|
|
GRANT USAGE ON SCHEMA osh TO postgres; |
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.offerings( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.offerings( |
|
|
|
|
offeringId VARCHAR(100), |
|
|
|
|
description VARCHAR(200), |
|
|
|
|
PRIMARY KEY (offeringId) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.results( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.results( |
|
|
|
|
resultsId SERIAL, |
|
|
|
|
datetime TIMESTAMP WITHOUT TIME ZONE DEFAULT (NOW() AT TIME ZONE 'utc') NOT NULL, |
|
|
|
|
state BOOLEAN, |
|
|
|
|
@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS covscanrest.results(
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.scans( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.scans( |
|
|
|
|
scanID SERIAL, |
|
|
|
|
offeringId VARCHAR(100), |
|
|
|
|
eventID VARCHAR(100) NOT NULL, |
|
|
|
|
@ -30,11 +30,11 @@ CREATE TABLE IF NOT EXISTS covscanrest.scans(
|
|
|
|
|
status VARCHAR (50) CONSTRAINT valid_status CHECK(status in ('PENDING', 'DELETED', 'COMPLETED', 'IN PROGRESS')), |
|
|
|
|
last_updated TIMESTAMP WITHOUT TIME ZONE DEFAULT (NOW() AT TIME ZONE 'utc') NOT NULL, |
|
|
|
|
PRIMARY KEY(scanID), |
|
|
|
|
FOREIGN KEY (offeringId) REFERENCES covscanrest.offerings(offeringId), |
|
|
|
|
FOREIGN KEY (results) REFERENCES covscanrest.results(resultsId) |
|
|
|
|
FOREIGN KEY (offeringId) REFERENCES osh.offerings(offeringId), |
|
|
|
|
FOREIGN KEY (results) REFERENCES osh.results(resultsId) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.archive( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.archive( |
|
|
|
|
scanID SERIAL, |
|
|
|
|
offeringId VARCHAR(100), |
|
|
|
|
eventID VARCHAR(100) NOT NULL, |
|
|
|
|
@ -46,11 +46,11 @@ CREATE TABLE IF NOT EXISTS covscanrest.archive(
|
|
|
|
|
status VARCHAR (50) CONSTRAINT valid_status CHECK(status in ('PENDING', 'DELETED', 'COMPLETED', 'IN PROGRESS')), |
|
|
|
|
last_updated TIMESTAMP WITHOUT TIME ZONE DEFAULT (NOW() AT TIME ZONE 'utc') NOT NULL, |
|
|
|
|
PRIMARY KEY(scanID), |
|
|
|
|
FOREIGN KEY (offeringId) REFERENCES covscanrest.offerings(offeringId), |
|
|
|
|
FOREIGN KEY (results) REFERENCES covscanrest.results(resultsId) |
|
|
|
|
FOREIGN KEY (offeringId) REFERENCES osh.offerings(offeringId), |
|
|
|
|
FOREIGN KEY (results) REFERENCES osh.results(resultsId) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.gitscans ( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.gitscans ( |
|
|
|
|
id SERIAL, |
|
|
|
|
buildSystemType VARCHAR(80), |
|
|
|
|
repository VARCHAR(150), |
|
|
|
|
@ -61,14 +61,14 @@ CREATE TABLE IF NOT EXISTS covscanrest.gitscans (
|
|
|
|
|
PRIMARY KEY(id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.pncscans( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.pncscans( |
|
|
|
|
id SERIAL, |
|
|
|
|
buildSystemType VARCHAR(80), |
|
|
|
|
buildId VARCHAR(100), |
|
|
|
|
PRIMARY KEY(id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS covscanrest.brewscans( |
|
|
|
|
CREATE TABLE IF NOT EXISTS osh.brewscans( |
|
|
|
|
id SERIAL, |
|
|
|
|
buildSystemType VARCHAR(80), |
|
|
|
|
brewId VARCHAR(100), |
|
|
|
|
@ -78,4 +78,4 @@ CREATE TABLE IF NOT EXISTS covscanrest.brewscans(
|
|
|
|
|
fileName VARCHAR(100), |
|
|
|
|
builtfromSource BOOLEAN, |
|
|
|
|
PRIMARY KEY(id) |
|
|
|
|
); |
|
|
|
|
); |
|
|
|
|
|