"""HasArtifact linked to PythonPackageVersionEntity

Revision ID: a8a4748e85cb
Revises: 331cbc965699
Create Date: 2019-10-09 12:26:39.197782+00:00

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("has_artifact", sa.Column("python_package_version_entity_id", sa.Integer(), nullable=False))
    op.create_foreign_key(
        None,
        "has_artifact",
        "python_package_version_entity",
        ["python_package_version_entity_id"],
        ["id"],
        ondelete="CASCADE",
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, "has_artifact", type_="foreignkey")
    op.drop_column("has_artifact", "python_package_version_entity_id")
    # ### end Alembic commands ###
