# type: ignore

"""content

Revision ID: 1454e4d1c6b8
Revises: 37c4f2719d65
Create Date: 2023-02-12 23:17:29.239758

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy import Column, Integer

# revision identifiers, used by Alembic.
revision = "1454e4d1c6b8"
down_revision = "37c4f2719d65"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    conn = op.get_bind()

    meta = sa.MetaData()
    meta.reflect(bind=conn, only=("medias",))
    old_table = meta.tables["medias"]
    if "media_id_2" not in old_table.columns:
        with op.batch_alter_table("medias", recreate="always") as batch_op:
            batch_op.add_column(Column("media_id_2", Integer), insert_after="id")

    pass
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###
