"""enable polymorphism for large binary

Revision ID: 63115797e6da
Revises: 377ef3aebfed
Create Date: 2023-02-06 09:21:47.923683

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "63115797e6da"
down_revision = "377ef3aebfed"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("largebinary_store", "record_id")
    op.add_column("largebinary_store", sa.Column("largebinary_type", sa.String(), nullable=True))
    op.execute(sa.text("UPDATE largebinary_store SET largebinary_type = 'generic'"))
    op.alter_column("largebinary_store", "largebinary_type", nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    raise RuntimeError("Cannot downgrade")
    # ### end Alembic commands ###
