-- [PIPES]

CREATE TYPE PIPES_STATUS AS ENUM ('OPEN', 'CLOSED', 'CV');

CREATE TABLE PIPES
(
  ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID)
, Node1 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL
, Node2 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL
, Length NUMERIC NOT NULL
, Diameter NUMERIC NOT NULL
, Roughness NUMERIC NOT NULL
, Minor_Loss NUMERIC NOT NULL
, Status PIPES_STATUS NOT NULL
);
