"""widen sha256-addressed ID columns from VARCHAR(36) to VARCHAR(128) Revision ID: a1b2c3d4e5f6 Revises: 4e68b95b48f3 Create Date: 2026-04-23 16:00:00.000000+00:00 """ from __future__ import annotations from typing import Sequence, Union import sqlalchemy as sa from alembic import op revision: str = "a1b2c3d4e5f6" down_revision: Union[str, None] = "4e68b95b48f3" branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None _COLUMNS: list[tuple[str, str]] = [ ("musehub_auth_keys", "key_id"), ("musehub_collaborators", "id"), ("musehub_domain_installs", "user_id"), ("musehub_domain_installs", "domain_id"), ("musehub_forks", "fork_id"), ("musehub_issue_comments", "parent_id"), ("musehub_issue_labels", "label_id"), ("musehub_labels", "id"), ("musehub_proposal_comments", "parent_comment_id"), ("musehub_proposal_labels", "label_id"), ("musehub_release_assets", "asset_id"), ("musehub_repos", "owner_user_id"), ("musehub_webhooks", "webhook_id"), ] def upgrade() -> None: for table, column in _COLUMNS: op.alter_column( table, column, type_=sa.String(length=128), existing_nullable=True, ) def downgrade() -> None: for table, column in _COLUMNS: op.alter_column( table, column, type_=sa.String(length=36), existing_nullable=True, )