From eb885c044f507e5d302634b785246835932640f0 Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 22 Aug 2026 11:36:09 +0200 Subject: [PATCH] fix: truncate furniture-line slug to fit caption_save varchar(25) Line pages used caption_save 'imp_line_' which could exceed the 25-char column limit (e.g. imp_line_pixel_collectible = 26 chars), causing the INSERT to fail. Cap the slug at 16 chars. --- src/lib/services/catalog-repair.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/services/catalog-repair.ts b/src/lib/services/catalog-repair.ts index 19c1581573..6e4fc372ea 100644 --- a/src/lib/services/catalog-repair.ts +++ b/src/lib/services/catalog-repair.ts @@ -506,12 +506,14 @@ export async function organizeCatalogAll(): Promise { const base = classname.split("*")[0]; return (base && furnilineByClass.get(base)) || ""; }; + // The `caption_save` column is varchar(25). The line prefix `imp_line_` + // takes 9 chars, so the slug may be at most 16 chars to stay within limit. const slug = (value: string): string => value .toLowerCase() .replace(/[^a-z0-9]+/g, "_") .replace(/^_+|_+$/g, "") - .slice(0, 40); + .slice(0, 16); // Minimum number of items a furniture line must have before it gets its own // dedicated catalog page. Lines below this threshold (one-off customs, etc.)