<gh_stars>0
"""Adicionado Tabelas

Revision ID: <KEY>
Revises: <KEY>
Create Date: 2021-06-02 17:33:44.509259

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('produtos', schema=None) as batch_op:
        batch_op.add_column(sa.Column('vendas_id', sa.Integer(), nullable=True))
        batch_op.create_foreign_key('fk_vendas', 'vendas', ['vendas_id'], ['id'])

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('produtos', schema=None) as batch_op:
        batch_op.drop_constraint('fk_vendas', type_='foreignkey')
        batch_op.drop_column('vendas_id')

    # ### end Alembic commands ###
