-- [PUMPS]

create table pumps
(
  id varchar(32) primary key references _link(id)
, node1 varchar(32) references _node(id) not null
, node2 varchar(32) references _node(id) not null
, power float8
, head varchar(32) references _curve(id)
, speed float8
, pattern varchar(32) references _pattern(id)
, check (power is not null or head is not null)
, check ((power is not null and head is not null) is false)
);

-- delete when delete node1
-- delete when delete node2
-- unset head when delete curve
-- unset pattern when delete pattern
