10 lines
355 B
SQL
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'));
|