[object Object]

← back to Japan Enrich

japan: Tier-1 canonical dw_unified stage runbook (approved; on_shopify=false, no Shopify, stage from live 18,272)

5b7654c0157aba36684985e240d37cca9c6c2257 · 2026-07-06 14:55:02 -0700 · Steve

Files touched

Diff

commit 5b7654c0157aba36684985e240d37cca9c6c2257
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jul 6 14:55:02 2026 -0700

    japan: Tier-1 canonical dw_unified stage runbook (approved; on_shopify=false, no Shopify, stage from live 18,272)
---
 db/TIER1-STAGE.md | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/db/TIER1-STAGE.md b/db/TIER1-STAGE.md
new file mode 100644
index 0000000..193a41c
--- /dev/null
+++ b/db/TIER1-STAGE.md
@@ -0,0 +1,40 @@
+# Tier 1 — stage Japan into CANONICAL dw_unified (on_shopify=false, NO Shopify)
+
+APPROVED 2026-07-06 (Steve). Stages the Sangetsu line into canonical `dw_unified`
+with `us_distributor='Goodrich (Thailand)'`, `on_shopify=false`. **Does NOT publish to
+Shopify** (Tier 2 stays settlement-gated). Runs ON Kamatera so it reads the LIVE staging
+file (18,272 SKUs), not the smaller Mac2 copy. Additive + reversible.
+
+## 1. Push the scripts (from Mac2)
+```sh
+rsync -avz ~/Projects/japan-enrich/db/ root@45.61.58.125:/root/Projects/japan-staging-viewer/db/
+```
+
+## 2. On Kamatera — install pg, create tables, stage, verify
+```sh
+ssh root@45.61.58.125
+cd /root/Projects/japan-staging-viewer
+npm i pg
+
+# canonical dw_unified DSN — pull from your DW env (do NOT hardcode):
+export DATABASE_URL=$(grep -m1 '^DATABASE_URL=' /root/Projects/Designer-Wallcoverings/.env | cut -d= -f2-)
+psql "$DATABASE_URL" -c 'select current_database()'          # sanity: dw_unified
+
+# a) tables (additive; UNIQUE(vendor_code,mfr_sku) for the upsert)
+psql "$DATABASE_URL" -f db/create-japan-catalog-tables.sql
+
+# b) stage the FULL live Sangetsu line (reads ../staging/sangetsu-staging.jsonl = 18,272)
+node db/stage-sangetsu-all.js
+
+# c) verify — expect ~18,272 rows, all Goodrich (Thailand), on_shopify all false
+psql "$DATABASE_URL" -c "select us_distributor, count(*), bool_or(on_shopify) any_live from sangetsu_catalog group by 1"
+```
+
+## Rollback
+```sh
+psql "$DATABASE_URL" -c "truncate sangetsu_catalog"        # or: drop table sangetsu_catalog;
+```
+
+## Do NOT (Tier 2 — still gated)
+- No `on_shopify=true`, no Shopify product create/publish.
+- Sangetsu murals (~60% birds/tropical) must clear the `settlement` gate before ANY publish.

← 955be29 japan viewer: contrarian-gate fixes — nginx port 9934, no-sp  ·  back to Japan Enrich  ·  japan: scrape REAL per-pattern Sangetsu distributor (.psg-si dcf3072 →