PhoenixKitPosts.CommentDislike (PhoenixKitPosts v0.1.3)

Copy Markdown View Source

Legacy schema for comment dislikes.

New comment dislikes should use PhoenixKitComments.CommentDislike instead.

Summary

Functions

Changeset for creating a comment dislike.

Types

t()

@type t() :: %PhoenixKitPosts.CommentDislike{
  __meta__: term(),
  comment: PhoenixKitPosts.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(dislike, attrs)

Changeset for creating a comment dislike.

Required Fields

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

Validation Rules

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