create type _node_type as enum ('junction', 'reservoir', 'tank');

create type _link_type as enum ('pipe', 'pump', 'valve');

create table _node
(
  id varchar(32) primary key
, type _node_type  not null
);

create table _link
(
  id varchar(32) primary key
, type _link_type  not null
);

create table _curve
(
  id varchar(32) primary key
);

create table _pattern
(
  id varchar(32) primary key
);
