Files
signal-platform/alembic/versions/017_add_trade_setup_strategy_rank.py
T
dennisthiessenandClaude Opus 4.8 1155c9ed1b
Deploy / lint (push) Successful in 7s
Deploy / test (push) Successful in 1m29s
Deploy / deploy (push) Successful in 42s
Shorten alembic revision ids to fit version_num VARCHAR(32)
The deploy's `alembic upgrade head` failed at 016->017 with
StringDataRightTruncationError: the revision id
"017_add_trade_setup_strategy_rank" is 33 chars, but Postgres's
alembic_version.version_num is VARCHAR(32). Offline/SQLite checks don't
enforce the length, so this only surfaced against prod Postgres.

Rename the revision ids to the repo's short numeric convention (017, 018);
descriptive filenames are kept. down_revision links updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 08:17:10 +02:00

28 lines
645 B
Python

"""Add production strategy rank fields to trade setups.
Revision ID: 017
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"
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")