"""merge heads

Revision ID: 72ab6c4c6a5f
Revises: 0a8006bd1732, add_docupulse_settings, add_manager_role, make_events_user_id_nullable
Create Date: 2025-06-05 14:21:46.046125

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


# revision identifiers, used by Alembic.
revision = '72ab6c4c6a5f'
down_revision = ('0a8006bd1732', 'add_docupulse_settings', 'add_manager_role', 'make_events_user_id_nullable')
branch_labels = None
depends_on = None


def upgrade():
    # Ensure is_manager column exists
    conn = op.get_bind()
    inspector = inspect(conn)
    columns = [col['name'] for col in inspector.get_columns('user')]
    
    with op.batch_alter_table('user', schema=None) as batch_op:
        if 'is_manager' not in columns:
            batch_op.add_column(sa.Column('is_manager', sa.Boolean(), nullable=True, server_default='false'))


def downgrade():
    pass
