Collapse catalog_items duplicates by (page_id, item_ids) so same item on a page is removed regardless of price

This commit is contained in:
openhands committed 2026-08-23 15:52:20 +02:00
1 parent 2b7b445b73
commit c043af318b
1 file changed
+2 -32
+2 -32
View File
@@ -130,22 +130,7 @@ export async function getFurniHealth(): Promise<FurniHealth> {
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<number> {
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(