Skip to content
Snippets Groups Projects
  • f00wl's avatar
    41da9722
    Add enablable Auth · 41da9722
    f00wl authored
    * Add bolean field to Auth class
    * Append migration
    * check TOTP enabled in login mechanism
    * enable password auth in signup mechanism
    Add enablable Auth
    f00wl authored
    * Add bolean field to Auth class
    * Append migration
    * check TOTP enabled in login mechanism
    * enable password auth in signup mechanism
f9130c1a10f7_add_enableable_auth.py 562 B
""" add enableable auth

Revision ID: f9130c1a10f7
Revises: 07709c08a6d7
Create Date: 2023-02-10 14:57:20.853487
"""

from alembic import op
import sqlalchemy as sa
import hiboo


revision = 'f9130c1a10f7'
down_revision = '07709c08a6d7'
branch_labels = None
depends_on = None


def upgrade():
    with op.batch_alter_table('auth') as batch_op:
        batch_op.add_column(sa.Column('enabled', sa.Boolean(), server_default="1", nullable=False))


def downgrade():
    with op.batch_alter_table('auth') as batch_op:
        batch_op.drop_column('auth', 'enabled')