"""empty message

Revision ID: 3935f488fc9a
Revises: be54b1485701
Create Date: 2019-10-23 13:41:09.401858

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "3935f488fc9a"
down_revision = "be54b1485701"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "campaign",
        sa.Column(
            "display_probability", sa.Numeric(precision=7, scale=6), nullable=True
        ),
    )
    op.add_column(
        "campaign",
        sa.Column(
            "display_probability_auto", sa.Numeric(precision=7, scale=6), nullable=True
        ),
    )

    op.create_check_constraint(
        op.f("display_probability_le_1_0"), "campaign", "display_probability <= 1.0"
    )
    op.create_check_constraint(
        op.f("display_probability_auto_le_1_0"),
        "campaign",
        "display_probability_auto <= 1.0",
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("display_probability_auto_le_1_0", "campaign")
    op.drop_constraint("display_probability_le_1_0", "campaign")
    op.drop_column("campaign", "display_probability_auto")
    op.drop_column("campaign", "display_probability")
    # ### end Alembic commands ###
