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:
1 parent
2b7b445b73
commit
c043af318b
1 file changed
+2
-32
@@ -130,22 +130,7 @@ export async function getFurniHealth(): Promise<FurniHealth> {
|
|||||||
SELECT item_name FROM items_base GROUP BY item_name HAVING COUNT(*) > 1
|
SELECT item_name FROM items_base GROUP BY item_name HAVING COUNT(*) > 1
|
||||||
) g`);
|
) g`);
|
||||||
|
|
||||||
const CAT_DUP_COLS = [
|
const CAT_DUP_COLS = ["page_id", "item_ids"];
|
||||||
"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 BC_DUP_COLS = ["page_id", "item_ids", "catalog_name", "extradata"];
|
const BC_DUP_COLS = ["page_id", "item_ids", "catalog_name", "extradata"];
|
||||||
const catCols = CAT_DUP_COLS.join(",");
|
const catCols = CAT_DUP_COLS.join(",");
|
||||||
const bcCols = BC_DUP_COLS.join(",");
|
const bcCols = BC_DUP_COLS.join(",");
|
||||||
@@ -316,22 +301,7 @@ async function dedupCatalogTable(table: string): Promise<number> {
|
|||||||
const grp =
|
const grp =
|
||||||
table === "catalog_items_bc"
|
table === "catalog_items_bc"
|
||||||
? ["page_id", "item_ids", "catalog_name", "extradata"]
|
? ["page_id", "item_ids", "catalog_name", "extradata"]
|
||||||
: [
|
: ["page_id", "item_ids"];
|
||||||
"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 on = grp.map((c) => `t.${c} <=> d.${c}`).join(" AND ");
|
const on = grp.map((c) => `t.${c} <=> d.${c}`).join(" AND ");
|
||||||
const r = (await db.execute(
|
const r = (await db.execute(
|
||||||
sql.raw(
|
sql.raw(
|
||||||
|
|||||||
Reference in new issue
Block a user