"""empty message

Revision ID: badf8bb7d56b
Revises: 8f51fb7f4e40
Create Date: 2019-06-04 09:25:44.871107

"""
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "badf8bb7d56b"
down_revision = "8f51fb7f4e40"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "application_keys",
        "created",
        existing_type=postgresql.TIMESTAMP(),
        nullable=True,
    )
    op.drop_index(
        "idx_task_validation_mapper_status_composite",
        table_name="task_invalidation_history",
    )
    op.create_index(
        "idx_task_validation_mapper_status_composite",
        "task_invalidation_history",
        ["mapper_id", "is_closed"],
        unique=False,
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(
        "idx_task_validation_mapper_status_composite",
        table_name="task_invalidation_history",
    )
    op.create_index(
        "idx_task_validation_mapper_status_composite",
        "task_invalidation_history",
        ["invalidator_id", "is_closed"],
        unique=False,
    )
    op.alter_column(
        "application_keys",
        "created",
        existing_type=postgresql.TIMESTAMP(),
        nullable=False,
    )
    # ### end Alembic commands ###
