← back to Dw Photo Capture
fix: dw_unified 'match design' works on Kamatera — drop non-existent min_variant_price column from unifiedSimilar (Kamatera schema differs from mac2); app now returns similar products. DW_UNIFIED_DB accepts a full postgres:// URI (app runs as root, no PG role). Verified: grasscloth swatch → 48 products live.
9277da43c7819ee5a7ad73cf76177bb24ab4a027 · 2026-07-06 15:59:40 -0700 · Steve Abrams
Files touched
M .env.exampleM server.js
Diff
commit 9277da43c7819ee5a7ad73cf76177bb24ab4a027
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jul 6 15:59:40 2026 -0700
fix: dw_unified 'match design' works on Kamatera — drop non-existent min_variant_price column from unifiedSimilar (Kamatera schema differs from mac2); app now returns similar products. DW_UNIFIED_DB accepts a full postgres:// URI (app runs as root, no PG role). Verified: grasscloth swatch → 48 products live.
---
.env.example | 6 +++++-
server.js | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.env.example b/.env.example
index 0816d04..6aacdd8 100644
--- a/.env.example
+++ b/.env.example
@@ -19,7 +19,11 @@ AUTH_PASS=DW2024!
# Shopify (SKU resolution / product features) — read-only Admin token (secrets: SHOPIFY_ADMIN_TOKEN).
SHOPIFY_ADMIN_TOKEN=
-# Postgres dw_unified (pattern-recognize similar-items + mfr→house-sku). On Kamatera the DB is local.
+# Postgres dw_unified (pattern-recognize similar-items + mfr→house-sku). The app shells to psql
+# with `-d $DW_UNIFIED_DB`, so this can be a plain db name (local peer auth) OR a full conninfo URI.
+# On Kamatera the app runs as root (no PG role), so use the URI form with real creds:
+# DW_UNIFIED_DB=postgresql://dw_admin:<pw>@127.0.0.1:5432/dw_unified (same creds as other DW apps' MICROSITE_DB_URL)
+# NB: dw_unified.shopify_products has NO min_variant_price column (schema differs from mac2).
PSQL=/usr/bin/psql
DW_UNIFIED_DB=dw_unified
diff --git a/server.js b/server.js
index 561c3bf..84c110f 100644
--- a/server.js
+++ b/server.js
@@ -1545,7 +1545,7 @@ function unifiedSimilar(terms) {
const score = t.map(x => `(case when ${hay} like '%${x}%' then 1 else 0 end)`).join('+');
const SQL = `select regexp_replace(coalesce(shopify_id,''),'\\D','','g') as product_id,
regexp_replace(coalesce(dw_sku,''),'-?sample$','','i'), coalesce(mfr_sku,''), coalesce(title,''), coalesce(vendor,''),
- coalesce(case when price>4.25 then price end, retail_price, min_variant_price, price),
+ coalesce(case when price>4.25 then price end, retail_price, price),
coalesce(image_url,''), upper(coalesce(status,'')), (${score}) as score
from shopify_products
where status ilike 'active' and image_url is not null and image_url <> '' and (${score}) > 0
← 1ffca17 feat: structured field auto-detect (sku#/model#/name/color)
·
back to Dw Photo Capture
·
feat: hone in on the text — OCR now reads a centered, upscal 5483a67 →