"""Remove mtime from Tracks

Revision ID: 164bd5ef3074
Revises: a524796269fa
Create Date: 2024-12-22 14:11:48.045995

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '164bd5ef3074'
down_revision = 'a524796269fa'
branch_labels = None
depends_on = None


def upgrade(engine_name: str) -> None:
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name: str) -> None:
    globals()["downgrade_%s" % engine_name]()





def upgrade_() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('tracks', schema=None) as batch_op:
        batch_op.drop_index('ix_tracks_mtime')
        batch_op.drop_column('mtime')

    # ### end Alembic commands ###


def downgrade_() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('tracks', schema=None) as batch_op:
        batch_op.add_column(sa.Column('mtime', mysql.FLOAT(), nullable=False))
        batch_op.create_index('ix_tracks_mtime', ['mtime'], unique=False)

    # ### end Alembic commands ###

