"""Add sessions

Revision ID: 821a722fb6c5
Revises: 371a1b269d3f
Create Date: 2017-05-04 14:38:19.372886

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '821a722fb6c5'
down_revision = '371a1b269d3f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('session',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('token', sa.String(length=32), nullable=True),
    sa.Column('expires', sa.DateTime(), nullable=True),
    sa.Column('awaiting_mfa', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('token')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('session')
    # ### end Alembic commands ###
