"""tz validity check

Revision ID: d00960aee998
Revises: b6f36a974e99
Create Date: 2019-09-20 13:03:13.735773

"""
from alembic import op

# revision identifiers, used by Alembic.
revision = "d00960aee998"
down_revision = "b6f36a974e99"
branch_labels = None
depends_on = None


def upgrade():
    op.create_check_constraint(
        op.f("timezone_is_pg_timezone"),
        "campaign",
        "now() AT TIME ZONE timezone IS NOT NULL",
    )


def downgrade():
    op.drop_constraint("timezone_is_pg_timezone", "campaign")
