[bugfix] correct sku relation to cards

This commit is contained in:
2026-04-08 15:38:56 -04:00
parent 3b4f98e556
commit 6811c4c249
2 changed files with 7 additions and 4 deletions

View File

@@ -234,4 +234,7 @@ where not exists (select 1 from cards where product_id=t.product_id and variant=
`);
console.log(`Inserted ${inserts.rowCount} rows into cards table`);
const skuUpdates = await db.execute(sql`update skus s set card_id = c.card_id from cards c where s.product_id = c.product_id and s.variant = c.variant and s.card_id is distinct from c.card_id`);
console.log(`Updated ${skuUpdates.rowCount} rows in skus table`);
}