fix: hide post

This commit is contained in:
Krispire Admin
2026-06-14 19:51:57 +05:30
parent 93e92c610c
commit 438258ade0
8 changed files with 176 additions and 8 deletions
@@ -0,0 +1,2 @@
DROP INDEX IF EXISTS posts_user_created_visible_idx;
ALTER TABLE posts DROP COLUMN IF EXISTS is_hidden;
+11
View File
@@ -0,0 +1,11 @@
-- Posts can be hidden from timelines (profile feed as seen by others, the
-- global home feed) and from public collections by their owner. Hidden posts
-- still appear to the owner on their own profile and in private collections.
ALTER TABLE posts
ADD COLUMN IF NOT EXISTS is_hidden BOOLEAN NOT NULL DEFAULT FALSE;
-- Partial index keeps the "visible posts, newest first" timeline/feed scans
-- cheap by excluding hidden rows from the index entirely.
CREATE INDEX IF NOT EXISTS posts_user_created_visible_idx
ON posts (user_id, created_at DESC)
WHERE is_hidden = FALSE;