"""make nullable false

Revision ID: 8e3f13ce98cb
Revises: cceebfa64b83
Create Date: 2021-11-03 19:43:59.841522

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8e3f13ce98cb'
down_revision = 'cceebfa64b83'
branch_labels = None
depends_on = None


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

    with op.batch_alter_table('attribute_date', schema=None) as batch_op:
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    with op.batch_alter_table('attribute_date_time', schema=None) as batch_op:
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    with op.batch_alter_table('attribute_float', schema=None) as batch_op:
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    with op.batch_alter_table('attribute_integer', schema=None) as batch_op:
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    with op.batch_alter_table('attribute_time', schema=None) as batch_op:
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    with op.batch_alter_table('attribute_unicode_text', schema=None) as batch_op:
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=False)
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    with op.batch_alter_table('type_field_association', schema=None) as batch_op:
        batch_op.alter_column('type_id',
               existing_type=sa.INTEGER(),
               nullable=False)

    # ### end Alembic commands ###


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

    with op.batch_alter_table('attribute_unicode_text', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    with op.batch_alter_table('attribute_time', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    with op.batch_alter_table('attribute_integer', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    with op.batch_alter_table('attribute_float', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    with op.batch_alter_table('attribute_date_time', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    with op.batch_alter_table('attribute_date', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    with op.batch_alter_table('attribute_boolean', schema=None) as batch_op:
        batch_op.alter_column('field_id',
               existing_type=sa.INTEGER(),
               nullable=True)
        batch_op.alter_column('type_field_association_iid',
               existing_type=sa.INTEGER(),
               nullable=True)

    # ### end Alembic commands ###
