"""Default column added to profile

Revision ID: 04c9051208cd
Revises: ed197421f25a
Create Date: 2026-02-03 13:08:18.193148

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '04c9051208cd'
down_revision: Union[str, Sequence[str], None] = 'ed197421f25a'
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('profile', sa.Column('is_default', sa.Boolean(), nullable=True))
    op.execute("UPDATE profile SET is_default = False WHERE is_default IS NULL")
    op.alter_column('profile', 'is_default', nullable=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('profile', 'is_default')
    # ### end Alembic commands ###
