rebuild(screener): add controlled formulas and rolling backtests

This commit is contained in:
leefer
2026-07-30 10:45:40 +08:00
parent 08f69b0641
commit b79b4ba280
21 changed files with 616 additions and 37 deletions
@@ -0,0 +1,31 @@
from __future__ import annotations
import sqlite3
from backend.database.migrations.runner import Migration
def upgrade(connection: sqlite3.Connection) -> None:
connection.execute(
"""
CREATE TABLE screener_run_backtests (
run_id INTEGER PRIMARY KEY
REFERENCES screener_runs(id) ON DELETE CASCADE,
payload_json TEXT NOT NULL,
created_at TEXT NOT NULL
)
"""
)
def downgrade(connection: sqlite3.Connection) -> None:
connection.execute("DROP TABLE screener_run_backtests")
MIGRATION = Migration(
version=12,
name="create_screener_backtests",
signature="screener:v2:persistent-rolling-backtests",
upgrade=upgrade,
downgrade=downgrade,
)