"""link order to producer

Revision ID: 8c11642354d1
Revises: c922de4fb67d
Create Date: 2016-05-30 20:38:47.916865

"""

# revision identifiers, used by Alembic.
revision = '8c11642354d1'
down_revision = 'c922de4fb67d'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('orders', sa.Column('producer_id', sa.Integer(), nullable=False, server_default='1'))
    op.create_foreign_key(None, 'orders', 'producers', ['producer_id'], ['id'])
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'orders', type_='foreignkey')
    op.drop_column('orders', 'producer_id')
    ### end Alembic commands ###
