15 lines
425 B
SQL
15 lines
425 B
SQL
create type scada_model_type as enum ('JUNCTION', 'RESERVOIR', 'TANK', 'PIPE', 'PUMP', 'VALVE');
|
|
|
|
create type scada_element_status as enum ('OFF', 'ON');
|
|
|
|
create table scada_element
|
|
(
|
|
id text primary key
|
|
, x float8 not null
|
|
, y float8 not null
|
|
, device_id text references scada_device(id)
|
|
, model_id varchar(32) -- add constraint in API
|
|
, model_type scada_model_type
|
|
, status scada_element_status not null default 'OFF'
|
|
);
|