"""User TOTP

Revision ID: 4fadf12fa98c
Revises: 54aec61bc15d
Create Date: 2025-10-26 21:31:09.258777

"""

import sqlalchemy as sa
import sqlmodel.sql.sqltypes
from alembic import op

# revision identifiers, used by Alembic.
revision = "4fadf12fa98c"
down_revision = "54aec61bc15d"
branch_labels = None
depends_on = None


def upgrade():
    with op.batch_alter_table("user", schema=None) as batch_op:
        batch_op.add_column(sa.Column("totp_enabled", sa.Boolean(), nullable=False, server_default="0"))
        batch_op.add_column(sa.Column("totp_secret", sqlmodel.sql.sqltypes.AutoString(), nullable=True))


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("user", schema=None) as batch_op:
        batch_op.drop_column("totp_secret")
        batch_op.drop_column("totp_enabled")

    # ### end Alembic commands ###
