feat(stock-lab): screener 스키마 7테이블 + 디폴트 설정 시드

This commit is contained in:
2026-05-12 04:10:36 +09:00
parent 8707d322e4
commit d7e235c008
3 changed files with 178 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ import os
import hashlib
from typing import List, Dict, Any, Optional
from app.screener.schema import ensure_screener_schema
DB_PATH = "/app/data/stock.db"
def _conn() -> sqlite3.Connection:
@@ -96,6 +98,9 @@ def init_db():
if "commission" not in sh_cols:
conn.execute("ALTER TABLE sell_history ADD COLUMN commission REAL NOT NULL DEFAULT 0")
# Screener 스키마 부트스트랩 (7테이블 + 디폴트 설정 시드)
ensure_screener_schema(conn)
def save_articles(articles: List[Dict[str, str]]) -> int:
count = 0
with _conn() as conn: