Junction schema linking a comment to an uploaded file.
Mirrors PhoenixKitPosts.PostMedia — each row attaches one
PhoenixKit.Modules.Storage.File to one PhoenixKitComments.Comment
with a stable position and an optional caption.
Fields
comment_uuid- The comment this media belongs tofile_uuid- TheStorage.Filerow (image / video / audio / document / other)position- 1-based display order within the comment's media listcaption- Optional caption / alt text
Constraints
- Unique
(comment_uuid, position)so reordering can't collide ON DELETE CASCADEoncomment_uuid: deleting a comment row also drops its media rowsON DELETE RESTRICTonfile_uuid: a file may be referenced by other comments or posts, so the junction row is the only thing detaching removes; the file is reaped by the storage GC pass when no junction rows reference it.
Summary
Functions
Changeset for creating or updating a comment-media link.
Types
@type t() :: %PhoenixKitComments.CommentMedia{ __meta__: term(), caption: String.t() | nil, comment: PhoenixKitComments.Comment.t() | Ecto.Association.NotLoaded.t(), comment_uuid: UUIDv7.t(), file: PhoenixKit.Modules.Storage.File.t() | Ecto.Association.NotLoaded.t(), file_uuid: UUIDv7.t(), inserted_at: DateTime.t() | nil, position: integer(), updated_at: DateTime.t() | nil, uuid: UUIDv7.t() | nil }