models: Add PwResetRequest model

This commit is contained in:
Cara Salter 2022-12-30 14:35:39 -05:00
parent 87a071b878
commit 41bad2b8b0
No known key found for this signature in database
GPG key ID: 90C66610C82B29CA
2 changed files with 36 additions and 0 deletions

View file

@ -50,3 +50,8 @@ def user_loader(user_id):
def unauth(): def unauth():
flash("Please login first") flash("Please login first")
return redirect(url_for("registration.register")) return redirect(url_for("registration.register"))
class PwResetRequest(db.Model):
id = Column(String, primary_key=True)
user_id = db.relationship("User")

View file

@ -0,0 +1,31 @@
"""empty message
Revision ID: db38c3deb0b9
Revises: a14a95ec57b0
Create Date: 2022-12-30 14:35:27.652423
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'db38c3deb0b9'
down_revision = 'a14a95ec57b0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('pw_reset_request',
sa.Column('id', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('pw_reset_request')
# ### end Alembic commands ###