alter table if exists search_rounds
  add column if not exists source_candidate_count integer,
  add column if not exists qualified_result_count integer,
  add column if not exists rejected_no_phone_count integer,
  add column if not exists target_result_count integer,
  add column if not exists shortage_reason text not null default '',
  add column if not exists require_phone_contact boolean not null default true;

alter table if exists final_result_products
  add column if not exists has_phone_contact boolean not null default false,
  add column if not exists qualification_status text not null default 'qualified',
  add column if not exists contact_collection_reason text not null default '';

create index if not exists idx_final_result_products_has_phone_contact
  on final_result_products(has_phone_contact);

create index if not exists idx_final_result_products_qualification_status
  on final_result_products(qualification_status);
