"""add onboarding and branding columns

Revision ID: 21ddb46ddd05
Revises: 061
Create Date: 2026-03-16 23:30:48.910485

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


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


def upgrade() -> None:
    # Users: onboarding + branding columns
    op.add_column('users', sa.Column('onboarding_dismissed', sa.Boolean(), server_default='false', nullable=False))
    op.add_column('users', sa.Column('logo_data', sa.Text(), nullable=True))
    op.add_column('users', sa.Column('logo_content_type', sa.String(length=50), nullable=True))
    op.add_column('users', sa.Column('company_display_name', sa.String(length=255), nullable=True))

    # Teams: branding columns
    op.add_column('teams', sa.Column('logo_data', sa.Text(), nullable=True))
    op.add_column('teams', sa.Column('logo_content_type', sa.String(length=50), nullable=True))
    op.add_column('teams', sa.Column('company_display_name', sa.String(length=255), nullable=True))


def downgrade() -> None:
    op.drop_column('teams', 'company_display_name')
    op.drop_column('teams', 'logo_content_type')
    op.drop_column('teams', 'logo_data')
    op.drop_column('users', 'company_display_name')
    op.drop_column('users', 'logo_content_type')
    op.drop_column('users', 'logo_data')
    op.drop_column('users', 'onboarding_dismissed')
