"""add_team_column_to_user_table

Revision ID: 824b7a3fdd47
Revises: f3c7bb1e9977
Create Date: 2017-10-04 16:59:34.887945

"""

# revision identifiers, used by Alembic.
revision = '824b7a3fdd47'
down_revision = 'f3c7bb1e9977'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('team_id', sa.BigInteger(), nullable=True))
    sa.ForeignKeyConstraint(['team_id'], ['teams.id'])
    op.create_index(op.f('ix_user_team_id'), 'users', ['team_id'], unique=False)
    ### end Alembic commands ###



def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_user_team_id'), table_name='users')
    op.drop_column('users', 'team_id')
    ### end Alembic commands ###
