"""Relax constraints for ExternalSoftwareEnvironment and SoftwareEnvironment for PackageExtractRun

Revision ID: 331cbc965699
Revises: 079e1d92f9d4
Create Date: 2019-10-08 15:51:15.249467+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "331cbc965699"
down_revision = "079e1d92f9d4"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "package_extract_run", "external_software_environment_id", existing_type=sa.INTEGER(), nullable=True
    )
    op.alter_column("package_extract_run", "software_environment_id", existing_type=sa.INTEGER(), nullable=True)
    op.alter_column("python_package_version", "package_version", existing_type=sa.VARCHAR(length=256), nullable=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column("python_package_version", "package_version", existing_type=sa.VARCHAR(length=256), nullable=False)
    op.alter_column("package_extract_run", "software_environment_id", existing_type=sa.INTEGER(), nullable=False)
    op.alter_column(
        "package_extract_run", "external_software_environment_id", existing_type=sa.INTEGER(), nullable=False
    )
    # ### end Alembic commands ###
