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,7 @@
-- Po přejmenování všech repeatable na R__NNN_* (globální pořadí dle závislostí fn/vw)
-- odstraníme záznamy repeatable z flyway historie. Při dalším migrate se znovu aplikují
-- všechny R__ skripty (CREATE OR REPLACE / GRANT je idempotentní).
DELETE FROM ems.flyway_schema_history
WHERE type = 'SQL'
AND version IS NULL;

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__fn_cop_estimate.sql
-- R__005_fn_cop_estimate.sql
-- EMS Platform odhad COP tepelného čerpadla dle venkovní teploty
-- Repeatable migration
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__fn_effective_price.sql
-- R__011_fn_effective_price.sql
-- EMS Platform funkce pro výpočet efektivní ceny per site
-- Repeatable migration nasazuje se při každé změně
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__fn_fill_audit_interval.sql
-- R__019_fn_fill_audit_interval.sql
-- EMS Platform plnění audit_interval ze skutečné telemetrie
-- Repeatable migration
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__fn_ote_import.sql
-- R__031_fn_ote_import.sql
-- OTE CZ import parser a import funkce
-- Repeatable migration při změně funkce stačí upravit tento soubor
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__fn_predict_negative_prices.sql
-- R__042_fn_predict_negative_prices.sql
-- Predikce oken se zvýšeným rizikem záporné spotové ceny (OTE).
-- Volat denně po importu cen a po forecastu FVE; výsledky ukládá do
-- ems.predicted_negative_price_window.

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__fn_set_mode.sql
-- R__044_fn_set_mode.sql
-- EMS Platform přepínání provozních režimů
-- Repeatable migration
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__vw_audit_summary.sql
-- R__053_vw_audit_summary.sql
-- EMS Platform přehledové views pro audit a dashboard
-- Repeatable migration
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__vw_energy_flows.sql
-- R__056_vw_energy_flows.sql
-- Denní agregace 6 základních Wh + 7 směrových toků z audit_interval
-- Repeatable migration (závisí na audit_interval + V042 sloupcech)
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__vw_latest_telemetry.sql
-- R__058_vw_latest_telemetry.sql
-- EMS Platform aktuální stav všech zařízení per lokalita
-- Repeatable migration
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__vw_operating_mode.sql
-- R__059_vw_operating_mode.sql
-- EMS Platform views pro provozní režimy a heartbeat
-- Repeatable migration
-- =============================================================

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__vw_site_effective_price.sql
-- R__061_vw_site_effective_price.sql
-- EMS Platform view efektivních cen per site
-- Repeatable migration
-- =============================================================

View File

@@ -1,7 +1,7 @@
-- =============================================================
-- R__vw_site_effective_price_economics.sql
-- R__067_vw_site_effective_price_economics.sql
-- EMS Platform ekonomické views (závisí na vw_site_effective_price)
-- Musí běžet až PO R__vw_site_effective_price.sql (abecední pořadí Flyway).
-- Musí běžet až PO R__061_vw_site_effective_price.sql (číselný prefix Flyway).
-- Repeatable migration
--
-- Pozn.: při změně pořadí / názvů výstupních sloupců nestačí CREATE OR REPLACE VIEW —

View File

@@ -1,5 +1,5 @@
-- =============================================================
-- R__vw_telemetry_15m_7d.sql
-- R__071_vw_telemetry_15m_7d.sql
-- EMS Platform telemetrie střídače po 15 min (dashboard sloty)
-- Repeatable migration jedna aktuální definice view
-- =============================================================

View File

@@ -1,4 +1,4 @@
-- PostgREST ems_anon: SELECT na views (repeatable po R__vw_* ve stejném Flyway běhu).
-- PostgREST ems_anon: SELECT na views (repeatable R__072 po ostatních vw_* v pořadí Flyway).
--
-- Po importu DB dumpu bez cluster rolí často chybí samotná role; V009 pak na cílovém
-- clusteru neběžela. Tento blok je idempotentní a při změně souboru znovu spáruje granty.