refactor(database): DbMigrator.cs에 KIS 수집 테이블 스키마 초기화 추가
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 6s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 13s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Deploy to Production / Build & Deploy to Production (push) Successful in 2m19s
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 6s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 13s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Deploy to Production / Build & Deploy to Production (push) Successful in 2m19s
- kis_collection_runs, kis_collection_snapshots, kis_collection_errors 테이블 정의를 DbMigrator.cs의 Migrate()에 추가. - 이를 통해 수집기가 시작되거나 API를 호출하기 전에 스키마가 데이터베이스 초기화 시점에 안전하게 준비되도록 함.
This commit is contained in:
@@ -105,6 +105,44 @@ namespace QuantEngine.Infrastructure.Data
|
||||
CREATE INDEX IF NOT EXISTS idx_collection_source_errors_run ON collection_source_errors(run_id, source_name);
|
||||
");
|
||||
|
||||
// 3b. KIS 데이터 수집 테이블 추가 (kis_collection_runs, kis_collection_snapshots, kis_collection_errors)
|
||||
conn.Execute(@"
|
||||
CREATE TABLE IF NOT EXISTS kis_collection_runs (
|
||||
run_id TEXT PRIMARY KEY,
|
||||
status TEXT NOT NULL,
|
||||
started_at TEXT NOT NULL,
|
||||
finished_at TEXT,
|
||||
total_snapshots INTEGER,
|
||||
total_errors INTEGER,
|
||||
updated_at TEXT NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_kis_runs_started_at ON kis_collection_runs(started_at DESC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS kis_collection_snapshots (
|
||||
run_id TEXT NOT NULL,
|
||||
dataset_name TEXT,
|
||||
ticker TEXT NOT NULL,
|
||||
source_name TEXT NOT NULL,
|
||||
payload_json TEXT NOT NULL,
|
||||
captured_at TEXT NOT NULL,
|
||||
created_at TEXT NOT NULL,
|
||||
PRIMARY KEY (run_id, ticker, source_name)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_kis_snapshots_ticker ON kis_collection_snapshots(ticker);
|
||||
CREATE INDEX IF NOT EXISTS idx_kis_snapshots_captured_at ON kis_collection_snapshots(captured_at DESC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS kis_collection_errors (
|
||||
id SERIAL PRIMARY KEY,
|
||||
run_id TEXT NOT NULL,
|
||||
source_name TEXT NOT NULL,
|
||||
error_kind TEXT NOT NULL,
|
||||
error_message TEXT,
|
||||
ticker TEXT,
|
||||
created_at TEXT NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_kis_errors_run_id ON kis_collection_errors(run_id);
|
||||
");
|
||||
|
||||
// 4. settings
|
||||
conn.Execute(@"
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
|
||||
Reference in New Issue
Block a user