"""Added UserAccessToken model

Revision ID: a5e8f6d68ca7
Revises: 1bc681714e49
Create Date: 2017-10-12 06:49:23.631008

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a5e8f6d68ca7'
down_revision = '1bc681714e49'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('UsersAccessTokens',
    sa.Column('UsersAccessTokenID', sa.Integer(), nullable=False),
    sa.Column('UserID', sa.Integer(), nullable=False),
    sa.Column('AccessToken', sa.String(length=40), nullable=True),
    sa.Column('RefreshToken', sa.String(length=40), nullable=True),
    sa.Column('ExpirationDate', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['UserID'], ['Users.UserID'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('UsersAccessTokenID')
    )
    # ### end Alembic commands ###


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