"""Artifact should link just to entity

Revision ID: 184e698fe2c2
Revises: a8a4748e85cb
Create Date: 2019-10-10 09:31:41.630561+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '184e698fe2c2'
down_revision = 'a8a4748e85cb'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('has_artifact_python_package_version_id_fkey', 'has_artifact', type_='foreignkey')
    op.drop_column('has_artifact', 'python_package_version_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('has_artifact', sa.Column('python_package_version_id', sa.INTEGER(), autoincrement=False, nullable=False))
    op.create_foreign_key('has_artifact_python_package_version_id_fkey', 'has_artifact', 'python_package_version', ['python_package_version_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###
