"""add frec_code to submission model

Revision ID: c42d328ef2fa
Revises: <PASSWORD>
Create Date: 2017-07-10 13:16:56.855163

"""

# revision identifiers, used by Alembic.
revision = 'c42d328ef2fa'
down_revision = '4<PASSWORD>'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('submission', sa.Column('frec_code', sa.Text(), nullable=True))
    op.add_column('frec', sa.Column('cgac_code', sa.Text(), nullable=True))
    ### end Alembic commands ###


def downgrade_data_broker():
    op.execute("DELETE FROM submission "
               "WHERE cgac_code IS NULL")
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('frec', 'cgac_code')
    op.drop_column('submission', 'frec_code')
    ### end Alembic commands ###

