-- Compatibility for installations predating the optional bank-ownership adapter.
-- Missing evidence remains unknown; a legacy "verified" status is never upgraded
-- into ownership or card-link proof merely by applying this migration.
begin;
alter table marketplace_private.bank_accounts add column if not exists ownership_checked_at timestamptz;
alter table marketplace_private.bank_accounts add column if not exists ownership_national_id text;
alter table marketplace_private.bank_accounts add column if not exists card_link_status text not null default 'not_checked' check(card_link_status in('not_checked','verified'));
notify pgrst,'reload schema';
commit;
