fix repeatable migrations

This commit is contained in:
Dusan Vojacek
2026-04-19 20:15:46 +02:00
parent 0c93f493a4
commit 22bca9cd9e
73 changed files with 22 additions and 15 deletions

View File

@@ -0,0 +1,18 @@
drop view if exists ems.vw_asset_inverter_modbus_poll;
create view ems.vw_asset_inverter_modbus_poll as
select
ai.site_id,
ai.id as inverter_id,
ai.code,
se.host,
se.port,
se.unit_id
from ems.asset_inverter ai
join ems.site_endpoint se on se.id = ai.endpoint_id
where ai.active = true
and se.enabled = true
and se.endpoint_type = 'modbus_tcp';
comment on view ems.vw_asset_inverter_modbus_poll is
'Aktivní střídače s Modbus TCP endpointem pro telemetry_collector.';