fix: update SQL queries to use FROM clause for catalog category joins

This commit is contained in:
BXY 2026-10-30 10:44:11 +08:00
parent 10034dbcee
commit 84db937041
2 changed files with 3 additions and 3 deletions

View File

@ -385,7 +385,7 @@ WHERE c.id = $1
if _, err := tx.ExecContext(ctx, fmt.Sprintf(`
UPDATE product.product_catalog_bindings pcb
SET deleted_at = NOW(), updated_at = NOW()
USING product.catalog_category pc
FROM product.catalog_category pc
WHERE pcb.category_id = pc.id
AND pc.node_type = 2
AND pc.store_id = $1

View File

@ -1988,7 +1988,7 @@ FOR KEY SHARE
if _, err := tx.ExecContext(ctx, `
UPDATE product.product_catalog_bindings AS b
SET deleted_at = NOW(), updated_at = NOW()
USING product.catalog_category AS c
FROM product.catalog_category AS c
WHERE b.product_id = $1
AND b.category_id = c.id
AND c.node_type = 1
@ -2086,7 +2086,7 @@ FOR KEY SHARE
if _, err := tx.ExecContext(ctx, `
UPDATE product.product_catalog_bindings AS b
SET deleted_at = NOW(), updated_at = NOW()
USING product.catalog_category AS c
FROM product.catalog_category AS c
WHERE b.product_id = $1
AND b.category_id = c.id
AND c.node_type = 2