-- [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
(
  pump varchar(32) primary key references pumps(id) not null
, price numeric not null
);

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

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