second version
This commit is contained in:
20
db/migration/V013__predicted_negative_price_window.sql
Normal file
20
db/migration/V013__predicted_negative_price_window.sql
Normal 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);
|
||||
Reference in New Issue
Block a user