"""Add Person.ldap_uid

Revision ID: f4ff5a73d283
Revises: 16df47d76c64
Create Date: 2023-08-07 13:05:48.693043

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "f4ff5a73d283"
down_revision = "16df47d76c64"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("person", schema=None) as batch_op:
        batch_op.add_column(
            sa.Column("ldap_uid", sa.String(length=60), nullable=True)
        )
        batch_op.create_unique_constraint(None, ["ldap_uid"])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("person", schema=None) as batch_op:
        batch_op.drop_constraint(None, type_="unique")
        batch_op.drop_column("ldap_uid")

    # ### end Alembic commands ###
