"""expand_rfp_profile_questionnaire_columns

Revision ID: a4714688877a
Revises: c7d8e9f0a1b2
Create Date: 2026-02-25 02:40:51.022897

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = 'a4714688877a'
down_revision: Union[str, Sequence[str], None] = 'c7d8e9f0a1b2'
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('rfp_profile', sa.Column('unique_travelers_annually', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('traveler_categories', postgresql.ARRAY(sa.String()), nullable=True))
    op.add_column('rfp_profile', sa.Column('expats_overseas', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('minor_children', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('travelers_75_to_84', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('travelers_85_plus', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('total_annual_travel_days', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('typical_trip_length_days', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('longest_trip_days', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('total_trips_annually', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('travel_group_pattern', sa.Enum('SOLO', 'SMALL_GROUPS', 'LARGE_GROUPS', 'MIXED', name='travelgrouppattern', native_enum=False), nullable=True))
    op.add_column('rfp_profile', sa.Column('typical_destinations', postgresql.ARRAY(sa.String()), nullable=True))
    op.add_column('rfp_profile', sa.Column('includes_remote_rural', sa.Boolean(), nullable=True))
    op.add_column('rfp_profile', sa.Column('activity_type', sa.Enum('BUSINESS', 'OPERATIONAL', 'MISSIONARY', 'HUMANITARIAN', 'ACADEMIC', 'OTHER', name='activitytype', native_enum=False), nullable=True))
    op.add_column('rfp_profile', sa.Column('activity_description', sa.Text(), nullable=True))
    op.add_column('rfp_profile', sa.Column('emergency_concern_type', sa.Enum('MEDICAL', 'SECURITY', 'MEDICAL_AND_SECURITY', name='emergencyconcerntype', native_enum=False), nullable=True))
    op.add_column('rfp_profile', sa.Column('coverage_scope', sa.Enum('INTERNATIONAL', 'DOMESTIC', 'INTERNATIONAL_AND_DOMESTIC', name='coveragescope', native_enum=False), nullable=True))
    op.add_column('rfp_profile', sa.Column('desktop_tracking_required', sa.Boolean(), nullable=True))
    op.add_column('rfp_profile', sa.Column('business_and_personal', sa.Boolean(), nullable=True))
    op.add_column('rfp_profile', sa.Column('incidents_past_5_years', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('incidents_past_year', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('medical_evacuations_annually', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('security_evacuations_annually', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('monitoring_staff_count', sa.Integer(), nullable=True))
    op.add_column('rfp_profile', sa.Column('has_gsoc', sa.Boolean(), nullable=True))
    op.add_column('rfp_profile', sa.Column('current_tmc', sa.String(length=255), nullable=True))
    op.add_column('rfp_profile', sa.Column('current_duty_of_care_provider', sa.String(length=255), nullable=True))
    op.add_column('rfp_profile', sa.Column('contract_expiration_date', sa.Date(), nullable=True))
    op.add_column('rfp_profile', sa.Column('desired_start_date', sa.Date(), nullable=True))
    op.create_unique_constraint('uq_rfp_profile_enterprise_name', 'rfp_profile', ['enterprise_name'])
    op.drop_column('rfp_profile', 'questionnaire_data')
    op.drop_column('rfp_profile', 'coverage_type')
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('rfp_profile', sa.Column('coverage_type', sa.VARCHAR(length=100), autoincrement=False, nullable=True))
    op.add_column('rfp_profile', sa.Column('questionnaire_data', postgresql.JSON(astext_type=sa.Text()), autoincrement=False, nullable=True))
    op.drop_constraint('uq_rfp_profile_enterprise_name', 'rfp_profile', type_='unique')
    op.drop_column('rfp_profile', 'desired_start_date')
    op.drop_column('rfp_profile', 'contract_expiration_date')
    op.drop_column('rfp_profile', 'current_duty_of_care_provider')
    op.drop_column('rfp_profile', 'current_tmc')
    op.drop_column('rfp_profile', 'has_gsoc')
    op.drop_column('rfp_profile', 'monitoring_staff_count')
    op.drop_column('rfp_profile', 'security_evacuations_annually')
    op.drop_column('rfp_profile', 'medical_evacuations_annually')
    op.drop_column('rfp_profile', 'incidents_past_year')
    op.drop_column('rfp_profile', 'incidents_past_5_years')
    op.drop_column('rfp_profile', 'business_and_personal')
    op.drop_column('rfp_profile', 'desktop_tracking_required')
    op.drop_column('rfp_profile', 'coverage_scope')
    op.drop_column('rfp_profile', 'emergency_concern_type')
    op.drop_column('rfp_profile', 'activity_description')
    op.drop_column('rfp_profile', 'activity_type')
    op.drop_column('rfp_profile', 'includes_remote_rural')
    op.drop_column('rfp_profile', 'typical_destinations')
    op.drop_column('rfp_profile', 'travel_group_pattern')
    op.drop_column('rfp_profile', 'total_trips_annually')
    op.drop_column('rfp_profile', 'longest_trip_days')
    op.drop_column('rfp_profile', 'typical_trip_length_days')
    op.drop_column('rfp_profile', 'total_annual_travel_days')
    op.drop_column('rfp_profile', 'travelers_85_plus')
    op.drop_column('rfp_profile', 'travelers_75_to_84')
    op.drop_column('rfp_profile', 'minor_children')
    op.drop_column('rfp_profile', 'expats_overseas')
    op.drop_column('rfp_profile', 'traveler_categories')
    op.drop_column('rfp_profile', 'unique_travelers_annually')
    # ### end Alembic commands ###
