"""Adds a distinct vulnerbility table column for keeping track of the initial review_feedback reviewer.

Revision ID: c10e1faccb1c
Revises: fb11cb6a2398
Create Date: 2020-10-03 09:50:58.363062

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "c10e1faccb1c"
down_revision = "fb11cb6a2398"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "vulnerability", sa.Column("feedback_reviewer_id", sa.Integer(), nullable=True)
    )
    op.create_foreign_key(
        "fk_feedback_reviewer_id",
        "vulnerability",
        "user",
        ["feedback_reviewer_id"],
        ["id"],
    )
    # ### end Alembic commands ###


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