"""Changed device_profile table

Revision ID: 34dc96ee805b
Revises: 414b87c32cc2
Create Date: 2024-09-12 04:42:15.909042

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '34dc96ee805b'
down_revision = '414b87c32cc2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('device_profiles', schema=None) as batch_op:
        batch_op.add_column(sa.Column('id', sa.Integer(), nullable=False))
        batch_op.alter_column('preference_key',
               existing_type=sa.String(length=255),
               nullable=False)
        batch_op.alter_column('preference_value',
               existing_type=sa.String(length=255),
               nullable=True)
        batch_op.alter_column('value_class',
               existing_type=sa.String(length=255),
               nullable=True)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('device_profiles', schema=None) as batch_op:
        batch_op.alter_column('value_class',
               existing_type=sa.String(length=255),
               nullable=False)
        batch_op.alter_column('preference_value',
               existing_type=sa.String(length=255),
               nullable=False)
        batch_op.alter_column('preference_key',
               existing_type=sa.String(length=255),
               nullable=False)
        batch_op.drop_column('id')

    # ### end Alembic commands ###
