"""update_channels

Revision ID: 7070a6fa8cdc
Revises: f6007bbf057d
Create Date: 2025-09-27 16:09:55.853051

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

# revision identifiers, used by Alembic.
revision = '7070a6fa8cdc'
down_revision = 'f6007bbf057d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('machine_update',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('game', sa.CHAR(length=4), nullable=False),
    sa.Column('version', sa.VARCHAR(length=15), nullable=False),
    sa.Column('channel', sa.VARCHAR(length=260), nullable=False),
    sa.Column('app_ini', sa.VARCHAR(length=260), nullable=True),
    sa.Column('opt_ini', sa.VARCHAR(length=260), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('game', 'version', 'channel', name='machine_update_uk'),
    mysql_charset='utf8mb4'
    )
    op.add_column('machine', sa.Column('ota_channel', sa.VARCHAR(length=260), nullable=True))
    op.drop_column('machine', 'ota_enable')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('machine', sa.Column('ota_enable', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
    op.drop_column('machine', 'ota_channel')
    op.drop_table('machine_update')
    # ### end Alembic commands ###
