Skip to content
Snippets Groups Projects
Commit b7ae347f authored by Henrik Thostrup Jensen's avatar Henrik Thostrup Jensen
Browse files

add db schema (postgres, because it is the right one)

parent 82a8bc6f
No related branches found
No related tags found
No related merge requests found
-- OpenNSA SQL Schema (PostgreSQL)
CREATE TYPE label AS (
label_type text,
label_value text
);
CREATE TABLE connections (
id serial PRIMARY KEY,
connection_id text NOT NULL UNIQUE,
revision integer NOT NULL,
global_reservation_id text,
description text,
state text NOT NULL,
nsa text NOT NULL,
source_network text NOT NULL,
source_port text NOT NULL,
source_labels label[],
dest_network text NOT NULL,
dest_port text NOT NULL,
dest_labels label[],
start_time timestamp with time zone NOT NULL,
end_time timestamp with time zone NOT NULL,
bandwidth integer NOT NULL -- mbps
);
CREATE TABLE subconnections (
id serial PRIMARY KEY,
provider_nsa text NOT NULL,
connection_id integer NOT NULL ,
revision integer NOT NULL,
parent_connection_id integer NOT NULL REFERENCES connections(id),
source_network text NOT NULL,
source_port text NOT NULL,
source_labels label[],
dest_network text NOT NULL,
dest_port text NOT NULL,
dest_labels label[],
UNIQUE (provider_nsa, connection_id)
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment