-- [ENERGY]

create table energy_global
(
  _no integer primary key
, price numeric not null
, pattern varchar(32) references _pattern(id)
, effic numeric not null
, demand_charge numeric not null
);

insert into energy_global (_no, price, pattern, effic, demand_charge)
  values (0, 0.0, null, 75, 0.0);

create table energy_pump_price
(
  id varchar(32) primary key references pumps(id) not null
, price numeric not null
);

create table energy_pump_pattern
(
  id varchar(32) primary key references pumps(id) not null
, pattern varchar(32) references _pattern(id) not null
);

create table energy_pump_effic
(
  id varchar(32) primary key references pumps(id) not null
, effic varchar(32) references _curve(id) not null
);
