From ae60c284788a78e90129e4590c1122ed64d92377 Mon Sep 17 00:00:00 2001 From: Henrik Thostrup Jensen <htj@nordu.net> Date: Wed, 1 May 2013 15:05:43 +0200 Subject: [PATCH] more schema updates, now with backend schema and more --- datafiles/schema.sql | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/datafiles/schema.sql b/datafiles/schema.sql index 60f9143c..f173c7b0 100644 --- a/datafiles/schema.sql +++ b/datafiles/schema.sql @@ -7,16 +7,19 @@ CREATE TYPE label AS ( ); -CREATE TABLE connections ( +-- publically reachable connections +CREATE TABLE service_connections ( id serial PRIMARY KEY, connection_id text NOT NULL UNIQUE, revision integer NOT NULL, global_reservation_id text, description text, nsa text NOT NULL, + reserve_time timestamp with time zone NOT NULL, reservation_state text NOT NULL, provision_state text NOT NULL, activation_state text NOT NULL, + lifecycle_state text NOT NULL, source_network text NOT NULL, source_port text NOT NULL, source_labels label[], @@ -28,13 +31,15 @@ CREATE TABLE connections ( bandwidth integer NOT NULL -- mbps ); - +-- internal references to connections that are part of a service connection CREATE TABLE subconnections ( id serial PRIMARY KEY, + service_connection_id integer NOT NULL REFERENCES service_connections(id), + connection_id text NOT NULL, provider_nsa text NOT NULL, - connection_id integer NOT NULL , + local_link boolean NOT NULL, revision integer NOT NULL, - parent_connection_id integer NOT NULL REFERENCES connections(id), + order_id integer NOT NULL, source_network text NOT NULL, source_port text NOT NULL, source_labels label[], @@ -44,3 +49,28 @@ CREATE TABLE subconnections ( UNIQUE (provider_nsa, connection_id) ); + +-- move this into the backend sometime +CREATE TABLE simplebackendconnections ( + id serial PRIMARY KEY, + connection_id text NOT NULL UNIQUE, + revision integer NOT NULL, + global_reservation_id text, + description text, + nsa text NOT NULL, + reserve_time timestamp with time zone NOT NULL, + reservation_state text NOT NULL, + provision_state text NOT NULL, + activation_state text NOT NULL, + lifecycle_state 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 +); + -- GitLab