"""Add status enum to task_order

Revision ID: 3d346b5c8f19
Revises: 71cbe76c3b87
Create Date: 2019-01-10 13:55:58.934890

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3d346b5c8f19'
down_revision = '71cbe76c3b87'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('task_orders', sa.Column('status', sa.Enum('PENDING', name='status', native_enum=False), nullable=True))
    # ### end Alembic commands ###

    conn = op.get_bind()
    conn.execute("UPDATE task_orders set status = 'PENDING'")


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('task_orders', 'status')
    # ### end Alembic commands ###
