diff --git a/internal/repository/product_batch.go b/internal/repository/product_batch.go index 1b79ab7..77d7afb 100644 --- a/internal/repository/product_batch.go +++ b/internal/repository/product_batch.go @@ -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 diff --git a/internal/repository/product_repository.go b/internal/repository/product_repository.go index 401be82..efaf29a 100644 --- a/internal/repository/product_repository.go +++ b/internal/repository/product_repository.go @@ -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