"""add labels_table

Revision ID: e8ad754184fd
Revises: b587da5794d6
Create Date: 2017-10-29 10:00:27.232737

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "character_labels",
        sa.Column("label_id", sa.Integer(), nullable=False),
        sa.Column("video_id", sa.Integer(), nullable=True),
        sa.Column("frame_number", sa.Integer(), nullable=False),
        sa.Column("object_x", sa.Integer(), nullable=False),
        sa.Column("object_y", sa.Integer(), nullable=False),
        sa.Column("object_w", sa.Integer(), nullable=False),
        sa.Column("object_h", sa.Integer(), nullable=False),
        sa.Column("character_id", sa.Integer(), nullable=True),
        sa.Column("timestamp_labelled", sa.String(length=10), nullable=False),
        sa.ForeignKeyConstraint(
            ["character_id"],
            ["characters.character_id"],
        ),
        sa.ForeignKeyConstraint(
            ["video_id"],
            ["videos.video_id"],
        ),
        sa.PrimaryKeyConstraint("label_id"),
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("character_labels")
    # ### end Alembic commands ###
