rebuild(screener): add controlled formulas and rolling backtests
This commit is contained in:
@@ -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,
|
||||
)
|
||||
@@ -9,6 +9,7 @@ from backend.database.migrations.m0008_mentor_llm import MIGRATION as MENTOR_LLM
|
||||
from backend.database.migrations.m0009_heaven import MIGRATION as HEAVEN
|
||||
from backend.database.migrations.m0010_review import MIGRATION as REVIEW
|
||||
from backend.database.migrations.m0011_operations import MIGRATION as OPERATIONS
|
||||
from backend.database.migrations.m0012_screener_backtests import MIGRATION as SCREENER_BACKTESTS
|
||||
from backend.database.migrations.runner import Migration
|
||||
|
||||
MIGRATIONS: tuple[Migration, ...] = (
|
||||
@@ -23,4 +24,5 @@ MIGRATIONS: tuple[Migration, ...] = (
|
||||
HEAVEN,
|
||||
REVIEW,
|
||||
OPERATIONS,
|
||||
SCREENER_BACKTESTS,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user