CREATE TABLE IF NOT EXISTS organization_bank_settings (
  id serial PRIMARY KEY,
  organization_id integer NOT NULL UNIQUE REFERENCES organizations(id) ON DELETE CASCADE,
  eft_account_name text NOT NULL,
  eft_institution_number text NOT NULL,
  eft_transit_number text NOT NULL,
  eft_account_number text NOT NULL,
  interac_recipient_name text NOT NULL,
  interac_email text NOT NULL,
  created_at timestamp NOT NULL DEFAULT now(),
  updated_at timestamp NOT NULL DEFAULT now()
);

CREATE INDEX IF NOT EXISTS org_bank_settings_org_updated_idx
  ON organization_bank_settings (organization_id, updated_at);
