One @ ping or # record link, indexed.
The canonical mention is the token inside the text — see
PhoenixKit.Mentions.Token for why. This row is a rebuilt-on-save cache
of the current head of one field, and exists to answer two questions the
text cannot answer cheaply:
- what links here — every record pointing at this one, without scanning every body in every module;
- what is new — so re-saving a comment doesn't re-notify everyone already mentioned in it.
Neither side carries a foreign key: both point into ~28 optional
packages' tables. actor_uuid does, because users are core's.
Summary
Types
@type t() :: %PhoenixKit.Mentions.Mention{ __meta__: term(), actor_uuid: UUIDv7.t() | nil, inserted_at: DateTime.t() | nil, kind: String.t() | nil, label: String.t() | nil, notified_at: DateTime.t() | nil, source_field: String.t() | nil, source_type: String.t() | nil, source_uuid: UUIDv7.t() | nil, target_type: String.t() | nil, target_uuid: UUIDv7.t() | nil, uuid: UUIDv7.t() | nil }
Functions
@spec changeset(t(), map()) :: Ecto.Changeset.t()
@spec kinds() :: [String.t()]
The two mention kinds: an @ ping and a # record link.