account/migrations/000002_price_history_intraday.down.sql
GnomeZworc d9581d7f7e
price pipeline
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2026-06-13 12:33:39 +02:00

10 lines
355 B
SQL

DROP TABLE IF EXISTS instrument_ticker_cache;
DROP TABLE IF EXISTS price_history;
CREATE TABLE price_history (
instrument_id INTEGER NOT NULL REFERENCES instrument(id),
date DATE NOT NULL,
prix NUMERIC(24, 8) NOT NULL,
PRIMARY KEY (instrument_id, date)
);
SELECT create_hypertable('price_history', by_range('date'));