0041_widen_symbol_intel_op_column.py
python
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2
feat: add repair-commit wire endpoint (API parity with repa…
Opus 4.8
minor
⚠ breaking
1 day 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
1 commit
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2
feat: add repair-commit wire endpoint (API parity with repa…
Opus 4.8
minor
⚠
1 day ago