Skip to content

Commit fd0fc0e

Browse files
committed
clean: remove OTPSession table
1 parent bf49c5e commit fd0fc0e

2 files changed

Lines changed: 33 additions & 13 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""Remove OTPSession table
2+
3+
Revision ID: fdb69cd98e19
4+
Revises: a541afdca952
5+
Create Date: 2025-12-21 15:34:01.851353
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
from sqlalchemy.dialects import postgresql
11+
12+
# revision identifiers, used by Alembic.
13+
revision = 'fdb69cd98e19'
14+
down_revision = 'a541afdca952'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
# ### commands auto generated by Alembic - please adjust! ###
21+
op.drop_table('otp_session')
22+
# ### end Alembic commands ###
23+
24+
25+
def downgrade():
26+
# ### commands auto generated by Alembic - please adjust! ###
27+
op.create_table('otp_session',
28+
sa.Column('secret', sa.VARCHAR(length=100), autoincrement=False, nullable=False),
29+
sa.Column('form', postgresql.BYTEA(), autoincrement=False, nullable=True),
30+
sa.Column('session', postgresql.BYTEA(), autoincrement=False, nullable=True),
31+
sa.PrimaryKeyConstraint('secret', name=op.f('otp_session_pkey'))
32+
)
33+
# ### end Alembic commands ###

selfservice/models.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ class PhoneVerification(db.Model):
5353
code = Column(String(6), primary_key=True)
5454
session = Column(String(36), ForeignKey("session.id"))
5555

56-
57-
class OTPSession(db.Model):
58-
"""
59-
Once an OTP secret has been generated for a user, we pickle their session
60-
so that we can retrieve it and eventually verify their token.
61-
"""
62-
63-
__tablename__ = "otp_session"
64-
secret = Column(String(100), primary_key=True)
65-
form = Column(LargeBinary)
66-
session = Column(LargeBinary)
67-
68-
6956
class AppSpecificPassword(db.Model):
7057
"""
7158
Allows users to authenticate to applications that don't support two factor

0 commit comments

Comments
 (0)