"""add_object_number_to_character_labels

Revision ID: 73cf781b10ad
Revises: e8ad754184fd
Create Date: 2017-10-29 11:20:52.544094

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "73cf781b10ad"
down_revision = "e8ad754184fd"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "character_labels", sa.Column("object_number", sa.Integer(), nullable=False)
    )
    op.create_unique_constraint(
        "object_label",
        "character_labels",
        ["video_id", "frame_number", "object_number"],
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("object_label", "character_labels", type_="unique")
    op.drop_column("character_labels", "object_number")
    # ### end Alembic commands ###
