Files
notifications-admin/migrations/versions/80_password_reset_token.py
T
Rebecca Law 2cb896fa81 Completion of forgot-password endpoints.
Start implementation for new-password endpoints.
Created PasswordResetToken model
ToDo: create and save token, send valid url to user,
check validity of token, update user's password, redirect to /two-factor.
2016-01-11 12:23:07 +00:00

36 lines
1.1 KiB
Python

"""empty message
Revision ID: 80_password_reset_token
Revises: 70_unique_email
Create Date: 2016-01-05 17:47:46.395959
"""
# revision identifiers, used by Alembic.
revision = '80_password_reset_token'
down_revision = '70_unique_email'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('password_reset_token',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('token', sa.String(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('expiry_date', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_password_reset_token_token'), 'password_reset_token', ['token'], unique=True)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_password_reset_token_token'), table_name='password_reset_token')
op.drop_table('password_reset_token')
### end Alembic commands ###