Skip to content

Drop engagement schema, migration 0026 (issue #85)#87

Merged
harshitsinghbhandari merged 14 commits into
mainfrom
remove-engagement-db
Jul 18, 2026
Merged

Drop engagement schema, migration 0026 (issue #85)#87
harshitsinghbhandari merged 14 commits into
mainfrom
remove-engagement-db

Conversation

@harshitsinghbhandari

Copy link
Copy Markdown
Member

Summary

Migration 0026_drop_engagement.sql dropping the engagement schema (closes #85). Stacked on #86 and must merge after it; apply the migration to production only after #86 is deployed, since the app must be off these objects before they are dropped.

Drops tables likes, comments, bookmarks, follows; columns posts.view_count/like_count/bookmark_count/comment_count, users.follower_count/following_count, mod_actions.target_comment_id; functions increment_post_view_count, comment_depth_for_parent, feed_shortlist_by_heat, and the three count-trigger functions. Narrows reports.target_type to ('post','user') and drops 'comment' from mod_actions.target_type, with guard-rail DELETEs subsuming every removed value. Recreates search_posts without count fields and users_public without follower counts (the view hard-depends on the dropped columns; caught in review). The 0024 approval-gate triggers on posts/reports/pinned_posts, resolve_session_gate, and the 0023 index are untouched.

Verification

  • pnpm typecheck, pnpm test (1035 tests) green, including a new 34-assertion static test for 0026
  • Every object name statically verified against its defining migration in review (SQL not executed against a live Postgres in this workflow)

🤖 Generated with Claude Code

harshitsinghbhandari and others added 14 commits July 18, 2026 19:59
Delete the comments feature end to end: API routes, UI components,
lib/comments helpers, and their tests. Strip the comment branches from
report/moderation code (reports schema, report creation, admin report
list and page, ReportActions, RestoreButton, audit page target-type
options) and drop the now-unused `comment` rate-limit bucket. Post and
user reports keep working; posts.comment_count display is left alone
for a later task per the plan.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Everyone gets the reverse-chronological feed the anon path already
rendered; the personalized For-You feed and all heat-score ranking
(lib/heat.ts, shortlist/rerank/affinity, trending tags/feed/strip,
/trending) are gone. Sidebar top-by-type rails switch from heat-score
to published_at recency and get retitled "Recent playbooks" / "Recent
deep dives". Like/bookmark/comment counts stay wired through for now;
Task 3 strips those.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… (issue #85)

- Capture .order() call arguments in test mock (orderArgs array) and assert
  the recency test verifies .order was called with 'published_at' and
  { ascending: false }; the suite can now detect dropped or reversed sorts.
- Remove unused 'hash' icon from RailIconName union and ICON_PATHS, leftover
  from deleted TrendingTagsRail component.
- Update .rail-heading CSS comment to reference only surviving consumers:
  TopByType (playbooks and deep dives) and FeaturedTagsFallback (featured
  topics).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Delete the likes/bookmarks routes, buttons, list page, and engagement
lookup, and strip like_count/bookmark_count/comment_count out of every
UI surface that displayed them: PostCard, the post detail page, the
home/latest/tag feeds, and search results. Rename the shared
'engagement' rate-limit bucket to 'follow' since /api/follows (removed
in a later task) was its only remaining consumer after likes/bookmarks
are gone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Delete the follow/unfollow feature: the API route, FollowButton,
UserCard, follow-state/follow-list lookups, and the followers/following
list pages. Strip follower_count/following_count from profile lookups
and the ProfileHeader stats row, and drop the now-unused follow
rate-limit bucket. The DB still has the follows table and count
columns; the app just stops reading them (Task 6 drops the schema).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Delete the view-beacon API route and component; strip view_count from
post/profile lookups and the view_count rate-limit bucket. Also removes
the now-dead Phase 7 comments CSS block (comments feature was fully
deleted in an earlier task on this branch) and fixes tests/docs that
were forced stale or broken by these deletions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- tests/e2e/a11y.spec.ts: remove /trending from PUBLIC_ROUTES
- tests/e2e/mobile.spec.ts: delete stale trending-strip test
- lib/feed/index.ts + app/page.tsx: rename ShortlistRow to LatestFeedRow
- tests/e2e/global-setup.ts: update comment (remove engagement/comments examples)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix three review findings on the engagement-drop migration: recreate
public.users_public (0014) without follower_count/following_count
before the column drops it otherwise blocks, widen the reports
guard-rail delete to NOT IN (post, user) so a stray org-target row
cannot fail the narrowed CHECK, and note that dropping
mod_actions.target_comment_id also retires its multi-column CHECK and
partial index from 0020.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@harshitsinghbhandari
harshitsinghbhandari merged commit 763de3d into main Jul 18, 2026
1 check passed
@harshitsinghbhandari
harshitsinghbhandari deleted the remove-engagement-db branch July 18, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove engagement layer (likes, comments, bookmarks, follows, view counts, trending)

1 participant