"""Update LOA to Array Type

Revision ID: db161adbafdf
Revises: 6512aa8d4641
Create Date: 2019-02-15 14:28:33.181136

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'db161adbafdf'
down_revision = '6512aa8d4641'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute("ALTER TABLE task_orders ALTER COLUMN loa TYPE varchar[] USING array[loa]")
    op.alter_column('task_orders', 'loa', new_column_name='loas')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute("ALTER TABLE task_orders ALTER COLUMN loas TYPE varchar USING loas[1]")
    op.alter_column('task_orders', 'loas', new_column_name='loa')
    # ### end Alembic commands ###
