use bigint for Fido.sign_count

This commit is contained in:
Son 2021-11-06 12:40:16 +01:00
parent bcf1fa2510
commit a1fdbc0caa
2 changed files with 27 additions and 1 deletions

View File

@ -232,7 +232,7 @@ class Fido(Base, ModelMixin):
nullable=False,
)
public_key = sa.Column(sa.String(), nullable=False, unique=True)
sign_count = sa.Column(sa.Integer(), nullable=False)
sign_count = sa.Column(sa.BigInteger(), nullable=False)
name = sa.Column(sa.String(128), nullable=False, unique=False)

View File

@ -0,0 +1,26 @@
"""empty message
Revision ID: 1076b5795b08
Revises: dd278f96ca83
Create Date: 2021-11-06 12:36:11.352157
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1076b5795b08'
down_revision = 'dd278f96ca83'
branch_labels = None
depends_on = None
def upgrade():
# As alembic cannot detect changes in column type, do it manually
op.execute('ALTER TABLE fido ALTER COLUMN sign_count TYPE BIGINT;')
def downgrade():
op.execute('ALTER TABLE fido ALTER COLUMN sign_count TYPE int;')