"""

Revision ID: 7a32a9c032b3
Revises: f5a91540a39d
Create Date: 2021-02-21 19:38:09.435682

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "7a32a9c032b3"
down_revision = "f5a91540a39d"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("sources", sa.Column("cache_session_id", sa.Integer(), nullable=True))
    op.create_foreign_key(
        None, "sources", "backtest_sessions", ["cache_session_id"], ["id"]
    )
    # ### end Alembic commands ###


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