[object Object]

← back to La Socrata Ingester

contacts: fix $2 type inference in linkedin_source CASE (::text cast)

7ba14e7cca88173e0a27c9520d8ecfaa87126b4f · 2026-08-12 09:49:57 -0700 · Steve Abrams

Files touched

Diff

commit 7ba14e7cca88173e0a27c9520d8ecfaa87126b4f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Aug 12 09:49:57 2026 -0700

    contacts: fix $2 type inference in linkedin_source CASE (::text cast)
---
 scripts/enrich-contacts.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/enrich-contacts.js b/scripts/enrich-contacts.js
index 9c38674..03d941f 100644
--- a/scripts/enrich-contacts.js
+++ b/scripts/enrich-contacts.js
@@ -78,8 +78,8 @@ async function enrichOne(c) {
     }
   }
   if (html) { out.linkedin = pickLinkedin(html); out.email = pickEmail(html, site); out.phone = pickPhone(html); }
-  await q(`UPDATE cslb_raw SET linkedin=$2, email=COALESCE($3,email), phone_web=$4,
-             linkedin_source=CASE WHEN $2 IS NOT NULL THEN 'site' ELSE linkedin_source END,
+  await q(`UPDATE cslb_raw SET linkedin=$2::text, email=COALESCE($3::text,email), phone_web=$4::text,
+             linkedin_source=CASE WHEN $2::text IS NOT NULL THEN 'site' ELSE linkedin_source END,
              contacts_enriched_at=now() WHERE "LicenseNo"=$1`,
     [c.LicenseNo, out.linkedin, out.email, out.phone]);
   return out;

← d5b07c9 contacts: linkedin_source tier (site=authoritative vs search  ·  back to La Socrata Ingester  ·  li-search: multi-source (cslb + rentv_licensed_targets) thro 71dd4ab →