diff --git a/tasks/caches/refresh_packages_caches.go b/tasks/caches/refresh_packages_caches.go index 6d21e8e8c..6cbefa44f 100644 --- a/tasks/caches/refresh_packages_caches.go +++ b/tasks/caches/refresh_packages_caches.go @@ -83,8 +83,8 @@ func getCounts(pkgSysCounts *[]models.PackageAccountData, accID *int) error { sp.rh_account_id rh_account_id, spkg.name_id package_name_id, count(*) as systems_installed, - count(*) filter (where update_status(spkg.update_data) = 'Installable') as systems_installable, - count(*) filter (where update_status(spkg.update_data) != 'None') as systems_applicable + count(*) filter (where update_data ? 'installable') as systems_installable, + count(*) filter (where (update_data ?| ARRAY['installable', 'applicable'])) as systems_applicable `). Joins("JOIN system_package spkg ON sp.id = spkg.system_id AND sp.rh_account_id = spkg.rh_account_id"). Joins("JOIN rh_account acc ON sp.rh_account_id = acc.id").