"""add orga relationship in bot

Revision ID: 8be7e10aaf8d
Revises: 0a477560dc09
Create Date: 2019-06-25 18:50:24.728435

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8be7e10aaf8d'
down_revision = '0a477560dc09'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('bots', sa.Column('organization_id', sa.Integer(), nullable=False))
    op.create_foreign_key(None, 'bots', 'organizations', ['organization_id'], ['id'])
    # ### end Alembic commands ###


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