fix: hide post
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP INDEX IF EXISTS posts_user_created_visible_idx;
|
||||
ALTER TABLE posts DROP COLUMN IF EXISTS is_hidden;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user