second version

This commit is contained in:
Dusan Vojacek
2026-04-03 14:23:16 +02:00
parent 897b95f728
commit 9f4126946d
105 changed files with 9738 additions and 1470 deletions

View File

@@ -0,0 +1,20 @@
-- Predikovaná okna záporných spotových cen (cache pro UI / API)
CREATE TABLE ems.predicted_negative_price_window (
id SERIAL PRIMARY KEY,
site_id INT NOT NULL REFERENCES ems.site (id),
predicted_at TIMESTAMPTZ NOT NULL DEFAULT now(),
predicted_date DATE NOT NULL,
window_start_hour INT NOT NULL,
window_end_hour INT NOT NULL,
probability_pct INT NOT NULL,
expected_min_price NUMERIC(10, 4),
reason TEXT,
UNIQUE (site_id, predicted_date, window_start_hour)
);
COMMENT ON TABLE ems.predicted_negative_price_window IS
'Výstup ems.fn_predict_negative_price_windows predikce intervalů s rizikem záporné nákupní ceny; obnovovat po importu cen a forecastu FVE.';
CREATE INDEX idx_predicted_neg_price_site_date
ON ems.predicted_negative_price_window (site_id, predicted_date);