← back to Dw Pairs Well
deploy/fix-osp-kamatera.sh — sync online_store_published flags Mac2→Kamatera (closes the last live leak class: ACTIVE-but-unpublished suggestions); flags TSV gitignored
6145281357dc8770c68f4ab75182ad1b954ec316 · 2026-07-13 01:36:28 -0700 · Steve Abrams
Files touched
M .gitignoreA deploy/fix-osp-kamatera.sh
Diff
commit 6145281357dc8770c68f4ab75182ad1b954ec316
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jul 13 01:36:28 2026 -0700
deploy/fix-osp-kamatera.sh — sync online_store_published flags Mac2→Kamatera (closes the last live leak class: ACTIVE-but-unpublished suggestions); flags TSV gitignored
---
.gitignore | 1 +
deploy/fix-osp-kamatera.sh | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/.gitignore b/.gitignore
index a8f2061..bf5ad72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ copy-of-*
tools/ci-hashes.jsonl
tools/pattern-id-by-dwsku.json
tools/pattern-id-titlefirst-by-dwsku.json
+deploy/osp-flags.tsv
diff --git a/deploy/fix-osp-kamatera.sh b/deploy/fix-osp-kamatera.sh
new file mode 100755
index 0000000..08cd2e8
--- /dev/null
+++ b/deploy/fix-osp-kamatera.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Fix the last live link-leak class: Kamatera's shopify_products lacks (or has stale)
+# online_store_published, so ACTIVE-but-unpublished products (peel-and-stick line etc.)
+# still surface as suggestions there. This syncs the flag from the fresh Mac2 mirror
+# (75,610 rows exported to osp-flags.tsv) into Kamatera's table, adding the column if
+# missing, then restarts pairs-well so its boot probe picks up the full gate.
+# RUN FROM MAC2: bash ~/Projects/dw-pairs-well/deploy/fix-osp-kamatera.sh
+set -euo pipefail
+cd "$(dirname "$0")"
+
+[ -s osp-flags.tsv ] || { echo "osp-flags.tsv missing — re-export from local mirror first"; exit 1; }
+
+scp -q osp-flags.tsv root@45.61.58.125:/tmp/osp-flags.tsv
+
+ssh root@45.61.58.125 'set -e
+ DB_URI="$(grep ^DATABASE_URL= /root/Projects/dw-pairs-well/.env | cut -d= -f2-)"
+ psql "$DB_URI" <<SQL
+ALTER TABLE shopify_products ADD COLUMN IF NOT EXISTS online_store_published boolean;
+CREATE TEMP TABLE osp_in (shopify_id text PRIMARY KEY, pub boolean);
+\\copy osp_in FROM '\''/tmp/osp-flags.tsv'\''
+UPDATE shopify_products sp SET online_store_published = o.pub
+FROM osp_in o WHERE o.shopify_id = sp.shopify_id
+ AND sp.online_store_published IS DISTINCT FROM o.pub;
+SELECT count(*) FILTER (WHERE online_store_published IS TRUE) AS published,
+ count(*) FILTER (WHERE online_store_published IS FALSE) AS unpublished,
+ count(*) FILTER (WHERE online_store_published IS NULL) AS unknown
+FROM shopify_products WHERE status='\''ACTIVE'\'';
+SQL
+ rm -f /tmp/osp-flags.tsv
+ pm2 restart dw-pairs-well
+ sleep 6
+ pm2 logs dw-pairs-well --lines 30 --nostream | grep link-guarantee | tail -2
+'
+echo "done — now re-verify: BASE=https://pairs.designerwallcoverings.com N=8 bash ../tools/live-link-check.sh"
← 82d7d3a SIMILAR_CLIP_DEFAULT one-switch flag; KAMATERA-GOLIVE.md pas
·
back to Dw Pairs Well
·
deps: bump qs to 6.15.3 via npm audit fix (GHSA-q8mj-m7cp-5q 73efede →