[object Object]

← back to Fentucci Naturals

FIX 1 residue: sync specs.pattern jsonb to renamed towns (235 rows had old town in tokiwa_catalog specs; viewer :9981 was serving it) + retown script now propagates to specs on every run

ab35a39e7b60badd6c05dcfadd2cb8390f5a02ce · 2026-07-22 18:56:52 -0700 · Steve Abrams

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Files touched

Diff

commit ab35a39e7b60badd6c05dcfadd2cb8390f5a02ce
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 22 18:56:52 2026 -0700

    FIX 1 residue: sync specs.pattern jsonb to renamed towns (235 rows had old town in tokiwa_catalog specs; viewer :9981 was serving it) + retown script now propagates to specs on every run
    
    Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---
 scripts/retown-collisions.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/retown-collisions.py b/scripts/retown-collisions.py
index c2af626..431e46b 100644
--- a/scripts/retown-collisions.py
+++ b/scripts/retown-collisions.py
@@ -147,6 +147,14 @@ def main():
         out = psql(sql)
         print(f"tokiwa_catalog: {old} -> {new}: {out.strip()}")
 
+    # 4b. specs jsonb carries its own pattern copy — sync it (2026-07-22 gap:
+    # the first run left 235 rows with the OLD town in specs->>'pattern')
+    out = psql(
+        "UPDATE tokiwa_catalog SET specs = jsonb_set(specs, '{pattern}', to_jsonb(pattern_name)) "
+        "WHERE specs->>'pattern' IS DISTINCT FROM pattern_name"
+    )
+    print(f"tokiwa_catalog specs.pattern sync: {out.strip()}")
+
     # ---- GATE: re-check ----
     assigned2 = {k: v["town"] for k, v in json.load(open(rm_path)).items()}
     dupes = len(assigned2) - len(set(assigned2.values()))

← 56057b4 auto-save: 2026-07-22T18:46:04 (2 files) — data/lookbook-ver  ·  back to Fentucci Naturals  ·  daily import cadence: 245/day tranche script + launchd com.s bae363c →