diff --git a/00-init.sql b/00-init.sql index f42950970db18a29672284579b252503afc85591..c1f39646550788d4fbe9398c358d2facf27e9829 100644 --- a/00-init.sql +++ b/00-init.sql @@ -30,7 +30,7 @@ CREATE EXTENSION IF NOT EXISTS ltree; CREATE TYPE NodeType AS ENUM ('container', 'data', 'link', 'structured'); -CREATE TYPE LocationType AS ENUM ('virtual', 'tape', 'user', 'LBT'); +CREATE TYPE LocationType AS ENUM ('async', 'user', 'portal'); CREATE TABLE node ( node_id BIGSERIAL NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE node ( os_name VARCHAR default NULL, tstamp_wrapper_dir VARCHAR default NULL, type NodeType NOT NULL, - location_type LocationType default 'virtual', + location_id SMALLINT NOT NULL, format VARCHAR default NULL, -- format is used to distinguish between unstuctured (format=NULL) and structured nodes having a well defined format async_trans BOOLEAN default false, @@ -78,7 +78,7 @@ CREATE TABLE deleted_node ( os_name VARCHAR default NULL, tstamp_wrapper_dir VARCHAR default NULL, type NodeType NOT NULL, - location_type LocationType default NULL, + location_id SMALLINT NOT NULL, format VARCHAR default NULL, -- format is used to distinguish between unstuctured (format=NULL) and structured nodes having a well defined format async_trans BOOLEAN default NULL, @@ -110,6 +110,15 @@ CREATE TABLE deleted_node ( ); +CREATE TABLE location ( + location_id SMALLSERIAL NOT NULL, + location_type LocationType NOT NULL, + base_path VARCHAR NOT NULL, + hostname VARCHAR NOT NULL, + PRIMARY KEY (location_id) +); + + CREATE TABLE users ( rap_id VARCHAR NOT NULL, user_name VARCHAR NOT NULL,