- Add ohlcv_bars table migration (050) for trading_service prediction loop - Fix kube-state-metrics RBAC: add admissionregistration.k8s.io and certificates.k8s.io API groups to suppress forbidden errors - Fix web-gateway gRPC stream reconnect: detect Unimplemented via both status code and error message text (proxy may remap codes) - Add automated migration step to CI deploy pipeline with tracking table (_applied_migrations) so migrations are applied before service rollouts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
639 B
SQL
17 lines
639 B
SQL
-- OHLCV bar data for prediction generation
|
|
-- Used by trading_service prediction_generation_loop to query recent market data
|
|
CREATE TABLE IF NOT EXISTS ohlcv_bars (
|
|
id BIGSERIAL PRIMARY KEY,
|
|
symbol VARCHAR(32) NOT NULL,
|
|
timestamp TIMESTAMPTZ NOT NULL,
|
|
open DOUBLE PRECISION NOT NULL,
|
|
high DOUBLE PRECISION NOT NULL,
|
|
low DOUBLE PRECISION NOT NULL,
|
|
close DOUBLE PRECISION NOT NULL,
|
|
volume DOUBLE PRECISION NOT NULL DEFAULT 0,
|
|
UNIQUE (symbol, timestamp)
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_ohlcv_bars_symbol_ts
|
|
ON ohlcv_bars (symbol, timestamp DESC);
|