PhoenixKit.Modules.Posts.CommentLike (phoenix_kit v1.7.62)

Copy Markdown View Source

Legacy schema for comment likes.

New comment likes should use PhoenixKit.Modules.Comments.CommentLike instead.

Summary

Functions

Changeset for creating a comment like.

Types

t()

@type t() :: %PhoenixKit.Modules.Posts.CommentLike{
  __meta__: term(),
  comment:
    PhoenixKit.Modules.Posts.PostComment.t() | Ecto.Association.NotLoaded.t(),
  comment_uuid: UUIDv7.t(),
  inserted_at: DateTime.t() | nil,
  updated_at: DateTime.t() | nil,
  user: PhoenixKit.Users.Auth.User.t() | Ecto.Association.NotLoaded.t(),
  user_uuid: UUIDv7.t() | nil,
  uuid: UUIDv7.t() | nil
}

Functions

changeset(like, attrs)

Changeset for creating a comment like.

Required Fields

  • comment_uuid - Reference to comment
  • user_uuid - Reference to user

Validation Rules

  • Unique constraint on (comment_uuid, user_uuid) - one like per user per comment