diff --git a/hiboo/models.py b/hiboo/models.py index 8931d7400fcae09f58375a0f4cd179f22804bea3..8ca33eeccdfb28daf72ad52f6110c50227eb0482 100644 --- a/hiboo/models.py +++ b/hiboo/models.py @@ -340,16 +340,6 @@ class ClaimName(db.Model): username = db.Column(db.String(255), nullable=False) -class ResetToken(db.Model): - """ A reset token is used to reset authentication for a given user. - """ - __tablename__ = "resettoken" - - user_uuid = db.Column(db.String(36), db.ForeignKey(User.uuid)) - user = db.relationship(User) - expired_at = db.Column(sqlalchemy.DateTime, nullable=False) - - class History(db.Model): """ Records an even in an account's or profile's lifetime. """ diff --git a/migrations/versions/07709c08a6d7_drop_resettoken.py b/migrations/versions/07709c08a6d7_drop_resettoken.py new file mode 100644 index 0000000000000000000000000000000000000000..39889d6ce93525a1ca930eaff562ae1baf9f53c3 --- /dev/null +++ b/migrations/versions/07709c08a6d7_drop_resettoken.py @@ -0,0 +1,36 @@ +""" drop resettoken + +Revision ID: 07709c08a6d7 +Revises: 134571bfe268 +Create Date: 2022-12-04 17:34:18.338493 +""" + +from alembic import op +import sqlalchemy as sa + + +revision = '07709c08a6d7' +down_revision = '134571bfe268' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('resettoken') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('resettoken', + sa.Column('user_uuid', sa.VARCHAR(length=36), nullable=True), + sa.Column('expired_at', sa.DATETIME(), nullable=False), + sa.Column('uuid', sa.VARCHAR(length=36), nullable=False), + sa.Column('created_at', sa.DATETIME(), nullable=False), + sa.Column('updated_at', sa.DATETIME(), nullable=True), + sa.Column('comment', sa.VARCHAR(length=255), nullable=True), + sa.ForeignKeyConstraint(['user_uuid'], ['user.uuid'], ), + sa.PrimaryKeyConstraint('uuid') + ) + # ### end Alembic commands ###