"""Add structured_delta column to musehub_commits. structured_delta was stored in the dropped commit_meta JSON blob. This migration adds it as a dedicated nullable JSONB column so the symbol indexer can read it back without losing fidelity on historical commits. New pushes write it directly; historical rows remain NULL and fall back to snapshot diffing. Revision ID: 0021 Revises: 0020 """ from __future__ import annotations from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSONB revision = "0021" down_revision = "0020" branch_labels = None depends_on = None def upgrade() -> None: op.add_column( "musehub_commits", sa.Column("structured_delta", JSONB(), nullable=True), ) def downgrade() -> None: from sqlalchemy import text op.execute(text("ALTER TABLE musehub_commits DROP COLUMN IF EXISTS structured_delta"))