"""add company logo field

Revision ID: f18735338888
Revises: 787468cfea77
Create Date: 2025-05-26 10:52:32.572951

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import inspect


# revision identifiers, used by Alembic.
revision = 'f18735338888'
down_revision = '787468cfea77'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    conn = op.get_bind()
    inspector = inspect(conn)
    columns = [col['name'] for col in inspector.get_columns('site_settings')]
    
    if 'company_logo' not in columns:
        with op.batch_alter_table('site_settings', schema=None) as batch_op:
            batch_op.add_column(sa.Column('company_logo', sa.String(length=255), nullable=True))

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('site_settings', schema=None) as batch_op:
        batch_op.drop_column('company_logo')

    # ### end Alembic commands ###
