"""Unique room names

Revision ID: 0925da921477
Revises: 764ce6db4388
Create Date: 2024-09-24 16:12:56.944133

"""

from typing import Sequence, Union

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "0925da921477"
down_revision: Union[str, None] = "764ce6db4388"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("room", schema=None) as batch_op:
        batch_op.create_unique_constraint("uq_room_name", ["name"])

    # ### end Alembic commands ###


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

    # ### end Alembic commands ###
