You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
787 B
SQL
35 lines
787 B
SQL
CREATE SCHEMA http;
|
|
/*
|
|
The purpose of this schema, tables, and associated roles to process HTTP responses.
|
|
I may even include a table to keep track of the XML responses
|
|
*/
|
|
|
|
/*
|
|
Add a role to manage permissions on the http schema
|
|
*/
|
|
CREATE ROLE http_requestor;
|
|
|
|
GRANT CONNECT ON DATABASE aact_db to http_requestor;
|
|
|
|
GRANT USAGE ON SCHEMA http TO http_requestor;
|
|
|
|
GRANT INSERT,SELECT ON ALL TABLES IN SCHEMA http TO http_requestor;
|
|
|
|
|
|
/* Create tables related to http requests
|
|
As not every request will have an xml doc, split them.
|
|
*/
|
|
|
|
CREATE TABLE IF NOT EXISTS http.responses (
|
|
id SERIAL PRIMARY KEY,
|
|
nct_id VARCHAR(15),
|
|
version_a SMALLINT,
|
|
version_b SMALLINT,
|
|
url VARCHAR(255),
|
|
response_code SMALLINT,
|
|
response_date TIMESTAMP WITH TIME ZONE,
|
|
html TEXT
|
|
);
|
|
|
|
|