05/17 fix migration script

This commit is contained in:
Nguyen Ngo
2026-05-17 18:33:01 -04:00
parent afc3250c48
commit e563693f40
2 changed files with 5 additions and 1 deletions
@@ -30,7 +30,9 @@ def upgrade():
op.create_table(
'recovery_challenges',
sa.Column('id', sa.Integer(), nullable=False, autoincrement=True),
sa.Column('user_id', sa.Integer(), nullable=False),
# user_id must be INTEGER UNSIGNED to match users.id (UNSIGNED primary key).
# MySQL 8 enforces strict type compatibility for foreign keys.
sa.Column('user_id', sa.Integer(unsigned=True), nullable=False),
sa.Column('nonce', sa.String(64), nullable=False),
sa.Column('expected_proof', sa.String(64), nullable=False),
sa.Column('expires_at', sa.DateTime(), nullable=False),