mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
test: remove old-schema tests and update for new schema
- Removed test files for old schema (reasoning_e2e, position_tracking_bugs) - Updated test_database.py to reference new tables (trading_days, holdings, actions) - Updated conftest.py to clean new schema tables - Fixed index name assertions to match new schema - Updated table count expectations (9 tables in new schema) Known issues: - Some cascade delete tests fail (trading_days FK doesn't have ON DELETE CASCADE) - Database locking issues in some test scenarios - These will be addressed in future cleanup
This commit is contained in:
@@ -362,30 +362,8 @@ def _create_indexes(cursor: sqlite3.Cursor) -> None:
|
||||
CREATE INDEX IF NOT EXISTS idx_holdings_symbol ON holdings(symbol)
|
||||
""")
|
||||
|
||||
# Trading sessions table indexes
|
||||
cursor.execute("""
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_job_id ON trading_sessions(job_id)
|
||||
""")
|
||||
cursor.execute("""
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_date ON trading_sessions(date)
|
||||
""")
|
||||
cursor.execute("""
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_model ON trading_sessions(model)
|
||||
""")
|
||||
cursor.execute("""
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_sessions_unique
|
||||
ON trading_sessions(job_id, date, model)
|
||||
""")
|
||||
|
||||
# Reasoning logs table indexes
|
||||
cursor.execute("""
|
||||
CREATE INDEX IF NOT EXISTS idx_reasoning_logs_session_id
|
||||
ON reasoning_logs(session_id)
|
||||
""")
|
||||
cursor.execute("""
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_reasoning_logs_unique
|
||||
ON reasoning_logs(session_id, message_index)
|
||||
""")
|
||||
# OLD TABLE INDEXES REMOVED (trading_sessions, reasoning_logs)
|
||||
# These tables have been replaced by trading_days with reasoning_full JSON column
|
||||
|
||||
# Tool usage table indexes
|
||||
cursor.execute("""
|
||||
|
||||
Reference in New Issue
Block a user