summaryrefslogtreecommitdiff
path: root/supabase/schema.sql
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-10 02:28:03 -0800
committerFuwn <[email protected]>2026-02-10 02:28:03 -0800
commit696e716163c6f1ad77a338a2cf755236ea5b03b3 (patch)
tree3fa4059dbdb534c0c59ba593bf5d37fab88d4d55 /supabase/schema.sql
parentfeat: add scrollbar style setting (themed/native/hidden) (diff)
downloadasa.news-696e716163c6f1ad77a338a2cf755236ea5b03b3.tar.xz
asa.news-696e716163c6f1ad77a338a2cf755236ea5b03b3.zip
fix: exclude hidden feeds from unread counts
get_unread_counts() now filters on hidden_from_timeline = false, so feeds hidden from the timeline no longer inflate the total unread badge or appear in aggregated counts.
Diffstat (limited to 'supabase/schema.sql')
-rw-r--r--supabase/schema.sql7
1 files changed, 4 insertions, 3 deletions
diff --git a/supabase/schema.sql b/supabase/schema.sql
index f5009f7..449976e 100644
--- a/supabase/schema.sql
+++ b/supabase/schema.sql
@@ -2,7 +2,7 @@
-- PostgreSQL database dump
--
--- \restrict EIsfb99KJ1xngT5GOQDV7f1tIMMDJiOJsvB1YZBvCSU5Qj8tsxmafuQpd9VaeJM
+-- \restrict W2cBW1TPQUb3U4lgbznQs959iNXBLp2VCiLY9C9QxhpgmdbQT0imaeM9WBwSLF7
-- Dumped from database version 17.6
-- Dumped by pg_dump version 17.6
@@ -818,7 +818,8 @@ CREATE OR REPLACE FUNCTION "public"."get_unread_counts"() RETURNS TABLE("feed_id
SELECT e.feed_id, COUNT(*) AS unread_count
FROM entries e
INNER JOIN subscriptions s ON s.feed_id = e.feed_id AND s.user_id = auth.uid()
- WHERE NOT EXISTS (
+ WHERE s.hidden_from_timeline = false
+ AND NOT EXISTS (
SELECT 1 FROM user_entry_states ues
WHERE ues.entry_id = e.id
AND ues.user_id = auth.uid()
@@ -3719,5 +3720,5 @@ ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT ALL ON TAB
-- PostgreSQL database dump complete
--
--- \unrestrict EIsfb99KJ1xngT5GOQDV7f1tIMMDJiOJsvB1YZBvCSU5Qj8tsxmafuQpd9VaeJM
+-- \unrestrict W2cBW1TPQUb3U4lgbznQs959iNXBLp2VCiLY9C9QxhpgmdbQT0imaeM9WBwSLF7