Files
foxhunt/migrations/050_create_ohlcv_bars.sql
jgrusewski 8ee1f810e6 fix(production): resolve all runtime errors and add CI migration automation
- 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>
2026-02-28 23:26:43 +01:00

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);