"""Make musehub_snapshots.manifest_blob nullable. snapshot_id = sha256(sorted manifest entries) — the ID is the proof. Snapshots pushed via the delta-mpack path store manifest_blob=NULL; the manifest can be reconstructed from the delta chain in MinIO. Revision ID: 0053 Revises: 0052 """ from __future__ import annotations import sqlalchemy as sa from alembic import op revision: str = "0053" down_revision: str = "0052" branch_labels = None depends_on = None def upgrade() -> None: op.alter_column( "musehub_snapshots", "manifest_blob", existing_type=sa.LargeBinary(), nullable=True, ) def downgrade() -> None: op.execute( "UPDATE musehub_snapshots SET manifest_blob = '\\x80' WHERE manifest_blob IS NULL" ) op.alter_column( "musehub_snapshots", "manifest_blob", existing_type=sa.LargeBinary(), nullable=False, )