Legacy schema for post comments.
Retained for backward compatibility with the phoenix_kit_post_comments table.
New comments should use PhoenixKit.Modules.Comments.Comment instead.
Summary
Functions
Changeset for creating or updating a comment.
Check if comment is deleted.
Check if comment is published.
Check if comment is a reply (has parent).
Check if comment is top-level (no parent).
Types
@type t() :: %PhoenixKit.Modules.Posts.PostComment{ __meta__: term(), children: [t()] | Ecto.Association.NotLoaded.t(), content: String.t(), depth: integer(), dislike_count: integer(), dislikes: [PhoenixKit.Modules.Posts.CommentDislike.t()] | Ecto.Association.NotLoaded.t(), inserted_at: DateTime.t() | nil, like_count: integer(), likes: [PhoenixKit.Modules.Posts.CommentLike.t()] | Ecto.Association.NotLoaded.t(), parent: t() | Ecto.Association.NotLoaded.t() | nil, parent_id: UUIDv7.t() | nil, post: PhoenixKit.Modules.Posts.Post.t() | Ecto.Association.NotLoaded.t(), post_id: UUIDv7.t(), status: String.t(), updated_at: DateTime.t() | nil, user: PhoenixKit.Users.Auth.User.t() | Ecto.Association.NotLoaded.t(), user_id: integer() | nil, user_uuid: UUIDv7.t() | nil, uuid: UUIDv7.t() | nil }
Functions
Changeset for creating or updating a comment.
Required Fields
post_id- Reference to postuser_id- Reference to commentercontent- Comment text
Validation Rules
- Content must not be empty
- Status must be valid (published/hidden/deleted/pending)
- Depth automatically calculated from parent
Check if comment is deleted.
Check if comment is published.
Check if comment is a reply (has parent).
Check if comment is top-level (no parent).