from alembic import op
from sqlalchemy.orm import sessionmaker

"""Set link_url for psa_tracker intervention

Revision ID: 67c2bea62313
Revises: e503ae1c261a
Create Date: 2018-09-06 23:11:50.564519

"""

# revision identifiers, used by Alembic.
revision = '67c2bea62313'
down_revision = 'e503ae1c261a'


Session = sessionmaker()


def upgrade():
    bind = op.get_bind()
    session = Session(bind=bind)
    session.execute(
        "UPDATE interventions SET link_url = '/psa-tracker' "
        "WHERE name = 'psa_tracker'")
    session.commit()


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###
