Files
ems/db/migration/V036__pv_array_telemetry_source.sql
Dusan Vojacek 5fcc47bce2
All checks were successful
test / smoke-test (push) Successful in 5s
deploy / deploy (push) Successful in 11s
implementace Ekonomiky
2026-04-05 20:10:43 +02:00

19 lines
908 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =============================================================
-- V036 asset_pv_array.telemetry_source
-- Explicitní mapování FVE pole → sloupec v telemetry_inverter.
-- =============================================================
ALTER TABLE ems.asset_pv_array
ADD COLUMN IF NOT EXISTS telemetry_source TEXT;
COMMENT ON COLUMN ems.asset_pv_array.telemetry_source IS
'Který sloupec v telemetry_inverter odpovídá tomuto poli.
gen_port = gen_port_power_w (AC-coupled pole na GEN portu),
pv_strings = pv1_power_w + pv2_power_w (DC stringy na MPPT),
pv_total = pv_power_w (souhrnné, pokud pole nelze rozlišit).
NULL = pole nemá přímou telemetrii (fallback na forecast).';
-- Seed pro referenční site home-01:
UPDATE ems.asset_pv_array SET telemetry_source = 'pv_strings' WHERE code = 'pv-a';
UPDATE ems.asset_pv_array SET telemetry_source = 'gen_port' WHERE code = 'pv-b';