PhoenixKit.Migrations.Postgres.V55 (phoenix_kit v1.7.71)

Copy Markdown View Source

V55: Standalone Comments Module

Creates polymorphic comments tables decoupled from the Posts module. Comments can be attached to any resource type via resource_type + resource_id.

Tables

  • phoenix_kit_comments — threaded comments with polymorphic resource association
  • phoenix_kit_comments_likes — comment like tracking
  • phoenix_kit_comments_dislikes — comment dislike tracking

Design

  • Polymorphic: resource_type (varchar) + resource_id (uuid), no FK constraints
  • Self-referencing parent_id for unlimited threading depth
  • Counter caches for like_count and dislike_count
  • Status-based moderation (published/hidden/deleted/pending)
  • Old phoenix_kit_post_comments tables remain untouched

Summary

Functions

down(opts)

up(opts)