"""refactored join table

Revision ID: 7a86ccf2c5bb
Revises: 6596cdfd93e2
Create Date: 2021-05-14 11:51:09.192913

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '7a86ccf2c5bb'
down_revision = '6596cdfd93e2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('product_materials',
    sa.Column('prod_id', sa.Integer(), nullable=False),
    sa.Column('material_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['material_id'], ['materials.id'], ),
    sa.ForeignKeyConstraint(['prod_id'], ['products.id'], ),
    sa.PrimaryKeyConstraint('prod_id', 'material_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('product_materials')
    # ### end Alembic commands ###
