"""make fields in product_relations non-nullable

Revision ID: aeec123e508c
Revises: ce157c2fa22e
Create Date: 2020-05-27 21:23:58.519384

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'aeec123e508c'
down_revision = 'ce157c2fa22e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('product_relations', schema=None) as batch_op:
        batch_op.alter_column('other_product_id',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('self_product_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('product_relations', schema=None) as batch_op:
        batch_op.alter_column('self_product_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('other_product_id',
               existing_type=sa.INTEGER(),
               nullable=True)

    # ### end Alembic commands ###
