"""Added country relation to SenderInfo

Revision ID: a72b2205b55c
Revises: f3afd6197391
Create Date: 2020-12-08 18:03:10.131819

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a72b2205b55c'
down_revision = 'f3afd6197391'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('sender_infos', sa.Column('country_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_sender_infos_country_id'), 'sender_infos', ['country_id'], unique=False)
    op.create_foreign_key(None, 'sender_infos', 'countries', ['country_id'], ['gid'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'sender_infos', type_='foreignkey')
    op.drop_index(op.f('ix_sender_infos_country_id'), table_name='sender_infos')
    op.drop_column('sender_infos', 'country_id')
    # ### end Alembic commands ###
