Migration 017 set down_revision to "016_add_signal_context_snapshots", but migration 016's revision id is "016", so `alembic upgrade head` could not resolve the chain and the deploy's auto-alembic step would fail. Point 017 at the real id "016". Add migration 018 to delete any persisted `paper_exit_mode` row. The July 2026 promotion changed the paper-trade exit default to `atr_trailing`, but `get_exit_policy` reads a stored value before the code default, so an environment that had ever saved the old `time` mode would silently keep it and never run the promoted 3x ATR trailing exit. Mirrors migration 015's one-way settings reset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
705 B
Python
28 lines
705 B
Python
"""Add production strategy rank fields to trade setups.
|
|
|
|
Revision ID: 017_add_trade_setup_strategy_rank
|
|
Revises: 016
|
|
Create Date: 2026-07-03 20:15:00.000000
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "017_add_trade_setup_strategy_rank"
|
|
down_revision = "016"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("trade_setups", sa.Column("strategy_rank", sa.Float(), nullable=True))
|
|
op.add_column("trade_setups", sa.Column("volatility_percentile", sa.Float(), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("trade_setups", "volatility_percentile")
|
|
op.drop_column("trade_setups", "strategy_rank")
|