From c043af318b28c0cf0525759acdb0dc591322995a Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 23 Aug 2026 15:52:20 +0200 Subject: [PATCH] Collapse catalog_items duplicates by (page_id, item_ids) so same item on a page is removed regardless of price --- src/lib/services/furni-maintenance.ts | 34 ++------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/src/lib/services/furni-maintenance.ts b/src/lib/services/furni-maintenance.ts index 18aeb044..18421243 100644 --- a/src/lib/services/furni-maintenance.ts +++ b/src/lib/services/furni-maintenance.ts @@ -130,22 +130,7 @@ export async function getFurniHealth(): Promise { SELECT item_name FROM items_base GROUP BY item_name HAVING COUNT(*) > 1 ) g`); - const CAT_DUP_COLS = [ - "page_id", - "item_ids", - "catalog_name", - "cost_credits", - "cost_points", - "points_type", - "amount", - "limited_sells", - "limited_stack", - "club_only", - "song_id", - "have_offer", - "extradata", - "badge", - ]; + const CAT_DUP_COLS = ["page_id", "item_ids"]; const BC_DUP_COLS = ["page_id", "item_ids", "catalog_name", "extradata"]; const catCols = CAT_DUP_COLS.join(","); const bcCols = BC_DUP_COLS.join(","); @@ -316,22 +301,7 @@ async function dedupCatalogTable(table: string): Promise { const grp = table === "catalog_items_bc" ? ["page_id", "item_ids", "catalog_name", "extradata"] - : [ - "page_id", - "item_ids", - "catalog_name", - "cost_credits", - "cost_points", - "points_type", - "amount", - "limited_sells", - "limited_stack", - "club_only", - "song_id", - "have_offer", - "extradata", - "badge", - ]; + : ["page_id", "item_ids"]; const on = grp.map((c) => `t.${c} <=> d.${c}`).join(" AND "); const r = (await db.execute( sql.raw(