0041_widen_symbol_intel_op_column.py
python
sha256:8e05daa29ba6702b4a2380a16d690ba31cc099d69c5c859bc6e6f16a0e945f99
Merge 'fix/deploy-memory-limits-and-log-group' into 'dev' —…
Human
5 days ago
| 1 | """Widen musehub_symbol_intel.op from VARCHAR(16) to VARCHAR(32). |
| 2 | |
| 3 | Revision ID: 0041 |
| 4 | Revises: 0040 |
| 5 | Create Date: 2026-05-07 |
| 6 | |
| 7 | Staging had VARCHAR(16) on this column; ORM model defines String(32). |
| 8 | Uses IF column length check so migration is safe to run on DBs where the |
| 9 | column is already the correct size. |
| 10 | """ |
| 11 | from __future__ import annotations |
| 12 | |
| 13 | from alembic import op |
| 14 | import sqlalchemy as sa |
| 15 | |
| 16 | |
| 17 | revision: str = "0041" |
| 18 | down_revision: str | None = "0040" |
| 19 | branch_labels = None |
| 20 | depends_on = None |
| 21 | |
| 22 | |
| 23 | def upgrade() -> None: |
| 24 | bind = op.get_bind() |
| 25 | cols = {c["name"]: c for c in sa.inspect(bind).get_columns("musehub_symbol_intel")} |
| 26 | op_col = cols.get("op") |
| 27 | if op_col and isinstance(op_col["type"], sa.VARCHAR) and op_col["type"].length == 16: |
| 28 | op.alter_column( |
| 29 | "musehub_symbol_intel", "op", |
| 30 | existing_type=sa.VARCHAR(length=16), |
| 31 | type_=sa.String(length=32), |
| 32 | existing_nullable=True, |
| 33 | ) |
| 34 | |
| 35 | |
| 36 | def downgrade() -> None: |
| 37 | bind = op.get_bind() |
| 38 | cols = {c["name"]: c for c in sa.inspect(bind).get_columns("musehub_symbol_intel")} |
| 39 | op_col = cols.get("op") |
| 40 | if op_col and isinstance(op_col["type"], sa.VARCHAR) and op_col["type"].length == 32: |
| 41 | op.alter_column( |
| 42 | "musehub_symbol_intel", "op", |
| 43 | existing_type=sa.String(length=32), |
| 44 | type_=sa.VARCHAR(length=16), |
| 45 | existing_nullable=True, |
| 46 | ) |
File History
3 commits
sha256:8e05daa29ba6702b4a2380a16d690ba31cc099d69c5c859bc6e6f16a0e945f99
Merge 'fix/deploy-memory-limits-and-log-group' into 'dev' —…
Human
5 days ago
sha256:3fadb0439bba9451b89229676971c0d4a40900dec7810e9d5f8791b8d950d505
fix: install.sh version from latest published tarball, not …
Sonnet 4.6
minor
⚠
96 days ago
sha256:763eb2cb8675073b84c19345b27586d2ed939a9aee97c5479b69f502f1a70eff
fix(tests): update test suite to match current implementation
Sonnet 4.6
patch
118 days ago