fix BA81 nevybijeni do site
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- planner_terminal_soc_value_factor: LP terminal SoC shadow price (planning_engine).
|
||||
-- V062 přidal sloupec NOT NULL default 0.9; tato migrace je idempotentní upevnění pro starší / ručně upravené DB.
|
||||
|
||||
update ems.asset_battery
|
||||
set planner_terminal_soc_value_factor = 0.9
|
||||
where planner_terminal_soc_value_factor is null;
|
||||
|
||||
alter table ems.asset_battery
|
||||
alter column planner_terminal_soc_value_factor set default 0.9;
|
||||
|
||||
alter table ems.asset_battery
|
||||
alter column planner_terminal_soc_value_factor set not null;
|
||||
@@ -66,7 +66,8 @@ begin
|
||||
)
|
||||
)::int,
|
||||
'charge_slot_buffer', ab.charge_slot_buffer,
|
||||
'discharge_slot_buffer', ab.discharge_slot_buffer
|
||||
'discharge_slot_buffer', ab.discharge_slot_buffer,
|
||||
'planner_terminal_soc_value_factor', ab.planner_terminal_soc_value_factor
|
||||
)
|
||||
into v_b
|
||||
from ems.asset_battery ab
|
||||
@@ -130,13 +131,6 @@ begin
|
||||
raise exception 'No site_grid_connection for site_id=%', p_site_id;
|
||||
end if;
|
||||
|
||||
-- LP tuning (battery-level): terminal SoC shadow price factor
|
||||
v_b := jsonb_set(
|
||||
v_b,
|
||||
'{planner_terminal_soc_value_factor}',
|
||||
to_jsonb(coalesce((v_b->>'planner_terminal_soc_value_factor')::numeric, 0.9))
|
||||
);
|
||||
|
||||
select coalesce(
|
||||
jsonb_agg(
|
||||
jsonb_build_object(
|
||||
|
||||
Reference in New Issue
Block a user