"""initial_with_new_columns

Revision ID: 4228f07bd5ad
Revises: 
Create Date: 2026-04-19 01:58:07.533812

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '4228f07bd5ad'
down_revision: Union[str, Sequence[str], None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('first_name', sa.String(length=50), server_default='User', nullable=False))
    op.add_column('users', sa.Column('last_name', sa.String(length=50), nullable=True))
    op.add_column('users', sa.Column('about', sa.String(), nullable=True))
    op.add_column('users', sa.Column('phone', sa.String(length=20), nullable=False))
    op.add_column('users', sa.Column('totp_secret', sa.String(length=32), nullable=True))
    op.create_unique_constraint(None, 'users', ['phone'])
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'users', type_='unique')
    op.drop_column('users', 'totp_secret')
    op.drop_column('users', 'phone')
    op.drop_column('users', 'about')
    op.drop_column('users', 'last_name')
    op.drop_column('users', 'first_name')
    # ### end Alembic commands ###
