-- [VALVES]

CREATE TYPE VALVES_TYPE AS ENUM ('prv', 'psv', 'pbv', 'fcv', 'tcv', 'gpv');

CREATE TABLE VALVES
(
  ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID)
, Node1 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL
, Node2 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL
, Diameter NUMERIC NOT NULL
, Type VALVES_TYPE NOT NULL
, Setting NUMERIC NOT NULL
, Minor_Loss NUMERIC NOT NULL
);
