"""Added eud_uid to device_profiles table, mysql fixes

Revision ID: 61c7cfea0c86
Revises: f2adbb61ff2f
Create Date: 2026-01-28 12:16:08.829691

"""

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

# revision identifiers, used by Alembic.
revision = "61c7cfea0c86"
down_revision = "f2adbb61ff2f"
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("eud_uid", sa.String(length=255), nullable=True))
        batch_op.create_foreign_key(None, "euds", ["eud_uid"], ["uid"], ondelete="CASCADE")

    # ### 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.drop_constraint(None, type_="foreignkey")
        batch_op.drop_column("eud_uid")

    # ### end Alembic commands ###
