"""Add currency_code column to investment table

Revision ID: 1b56e85c41fa
Revises: a44974f9c361
Create Date: 2021-03-18 20:31:52.688844

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '1b56e85c41fa'
down_revision = 'a44974f9c361'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('investment', sa.Column('currency_code', sa.String(), nullable=True))
    op.create_foreign_key(op.f('fk_investment_currency_code_currency'), 'investment', 'currency', ['currency_code'], ['currency_code'], ondelete='NO ACTION')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('fk_investment_currency_code_currency'), 'investment', type_='foreignkey')
    op.drop_column('investment', 'currency_code')
    # ### end Alembic commands ###
