-- [STATUS]

create type status_pipe_pump_status as enum ('open', 'closed');

create table status_pipe
(
  id varchar(32) primary key references pipes(id)
, status status_pipe_pump_status not null
);

create table status_pump
(
  id varchar(32) primary key references pumps(id)
, status status_pipe_pump_status not null
);

create type status_valve_status as enum ('open', 'closed', 'active');

create table status_valve
(
  id varchar(32) primary key references valves(id)
, status status_valve_status not null
);

create table status_link
(
  id varchar(32) primary key references _link(id)
, setting numeric not null
);
