"""added      is_2FA_required = Column(Boolean, default=False,nullable=False)

Revision ID: 53752dd97cdd
Revises: 2b9b4af9a472
Create Date: 2025-05-10 19:39:30.231726

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '53752dd97cdd'
down_revision: Union[str, None] = '2b9b4af9a472'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('is_2FA_required', sa.Boolean(), nullable=True))

     # Step 2: Set default values for existing records
    op.execute('UPDATE users SET "is_2FA_required" = false')

    # Step 3: Alter columns to be NOT NULL
    op.alter_column('users', 'is_2FA_required', nullable=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('users', 'is_2FA_required')
    # ### end Alembic commands ###
