"""Add unique constraint to reference_number

Revision ID: 13bbb295acd6
Revises: a3c910b017bf
Create Date: 2026-03-30 13:54:35.960039

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '13bbb295acd6'
down_revision = 'a3c910b017bf'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('inspections', schema=None) as batch_op:
        batch_op.create_unique_constraint('uq_inspections_reference_number', ['reference_number'])

    # ### end Alembic commands ###


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

    # ### end Alembic commands ###
