"""added condition

Peek Plugin Database Migration Script

Revision ID: 1ac6c325c7e5
Revises: 9e52cf449784
Create Date: 2019-08-05 11:48:30.808843

"""

# revision identifiers, used by Alembic.
revision = "1ac6c325c7e5"
down_revision = "9e52cf449784"
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
import geoalchemy2


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "Menu",
        sa.Column("showCondition", sa.String(), nullable=True),
        schema="pl_docdb_generic_menu",
    )
    op.add_column(
        "Menu",
        sa.Column("tooltip", sa.String(), nullable=True),
        schema="pl_docdb_generic_menu",
    )
    op.alter_column(
        "Menu",
        "title",
        existing_type=sa.VARCHAR(),
        nullable=True,
        schema="pl_docdb_generic_menu",
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "Menu",
        "title",
        existing_type=sa.VARCHAR(),
        nullable=False,
        schema="pl_docdb_generic_menu",
    )
    op.drop_column("Menu", "tooltip", schema="pl_docdb_generic_menu")
    op.drop_column("Menu", "showCondition", schema="pl_docdb_generic_menu")
    # ### end Alembic commands ###
