"""Removed unique restrinction from dataset audio_dir.

Revision ID: ef4af2e772f7
Revises: 03a1d239e06e
Create Date: 2024-09-18 22:17:23.612669

"""

from typing import Sequence, Union

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "ef4af2e772f7"
down_revision: Union[str, None] = "03a1d239e06e"
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("dataset") as batch_op:
        batch_op.drop_constraint(
            "uq_dataset_audio_dir",
            type_="unique",
        )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("dataset") as batch_op:
        batch_op.create_unique_constraint(
            "uq_dataset_audio_dir",
            ["audio_dir"],
        )
    # ### end Alembic commands ###
