Skip to content

Commit

Permalink
fix: count_all_apps method don't count not published app
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 6, 2023
1 parent 973128a commit bf462d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions supabase/migrations/20230321023005_create_base_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,11 @@ CREATE FUNCTION public.count_all_apps() RETURNS integer
LANGUAGE plpgsql
AS $$
Begin
RETURN (SELECT
(SELECT COUNT(*) FROM apps)+
(SELECT COUNT(*) FROM (SELECT DISTINCT app_id FROM store_apps where onprem = true or capgo = true) AS temp)
AS SumCount);
RETURN (SELECT COUNT(*) FROM (
SELECT app_id FROM apps
UNION
SELECT DISTINCT app_id FROM store_apps where (onprem = true or capgo = true) and url != ''
) AS temp);
End;
$$;

Expand Down

0 comments on commit bf462d1

Please sign in to comment.