"""Add password reset table.

Revision ID: cd2ca183062
Revises: 124fff07cbcb
Create Date: 2013-01-30 01:53:35.340191

"""

# revision identifiers, used by Alembic.
revision = 'cd2ca183062'
down_revision = '124fff07cbcb'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(u'passwordreset',
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
    sa.Column('reset_token', sa.Binary(length=16), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], [u'user.id'], ),
    sa.PrimaryKeyConstraint('reset_token'),
    sa.UniqueConstraint('user_id')
    )
    ### end Alembic commands ###


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