← back to Japan Enrich

db/EXECUTE-APPROVED.md

43 lines

# APPROVED execution runbook — distributor internal lines in dw_unified + flags
Steve approved 2026-07-06 ("approve all"). Run each block via `!` in Claude Code or a terminal.
Classifier blocks Claude from canonical writes; these run under YOU. Keep_offline + use_for_ai as specced.

## A. Canonical dw_unified — schema flag + internal lines + keep-offline (run on Kamatera)
```sh
ssh root@45.61.58.125 'cd /root/Projects/japan-staging-viewer && npm i pg -s && \
 export DATABASE_URL=$(grep -m1 "^DATABASE_URL=" /root/Projects/Designer-Wallcoverings/.env | cut -d= -f2-) && \
 rsync_ok=1; psql "$DATABASE_URL" -v ON_ERROR_STOP=1 <<SQL
-- new flag: use_for_ai (the one net-new column)
ALTER TABLE vendor_registry ADD COLUMN IF NOT EXISTS use_for_ai boolean DEFAULT false;
-- 20 distributor internal lines (vendor_code = <slug>-sg to avoid clobbering existing Koroseal/ColeSon/Harlequin)
-- keep_offline via vendor_never_on_shopify; use_for_ai=true on the registry row.
SQL'
```
Then load the 20 lines from the manifest (script does registry insert + vendor_never_on_shopify + use_for_ai):
```sh
rsync -avz ~/Projects/japan-enrich/db/ ~/Projects/japan-enrich/staging/onboarding-manifest.json \
  root@45.61.58.125:/root/Projects/japan-staging-viewer/db/
ssh root@45.61.58.125 'cd /root/Projects/japan-staging-viewer && \
 export DATABASE_URL=$(grep -m1 "^DATABASE_URL=" /root/Projects/Designer-Wallcoverings/.env | cut -d= -f2-) && \
 node db/load-distributor-lines.js'   # ← to be written: reads onboarding-manifest.json, upserts vendor_registry(+use_for_ai=true), inserts vendor_never_on_shopify
```

## B. Tier-1 product stage (sangetsu_catalog, on_shopify=false) — see db/TIER1-STAGE.md

## C. DNS — wildcard for all 20 subdomains (needs your registrar)
designerwallcoverings.com apex → Shopify (23.227.38.65); japan./china. → Kamatera (45.61.58.125).
Add ONE record so every distributor subdomain resolves to Kamatera:
```
*.designerwallcoverings.com   A   45.61.58.125     (or CNAME → the Kamatera host)
```
Tell me the registrar (GoDaddy / Cloudflare) and I'll do it via the domain tooling, or add it in the DNS panel.

## D. nginx (Kamatera, sudo) — route the wildcard to japan-viewer :9934
```sh
# add to the japan-viewer server block:  server_name *.designerwallcoverings.com;
# then: nginx -t && systemctl reload nginx && certbot --nginx -d '*.designerwallcoverings.com' (DNS-01)
```

## E. Fleet registry
Add the 20 slugs to all-designerwallcoverings/config/known-subdomains.json under "internal".