PhoenixKit.Modules.Connections.ConnectionHistory (phoenix_kit v1.7.42)

Copy Markdown View Source

Schema for connection activity history.

Records all connection-related events for auditing and activity feeds. The main Connection table stores only current state per user pair, while this table preserves the complete history of actions.

Actions

  • "requested" - User requested a connection
  • "accepted" - User accepted a connection request
  • "rejected" - User rejected a connection request
  • "removed" - User removed an existing connection

Fields

  • user_a_uuid / user_b_uuid - The two users involved (stored with lower UUID first for consistency)
  • actor_uuid - The user who performed this action
  • user_a_id / user_b_id / actor_id - Integer IDs (deprecated, dual-write only)

Summary

Functions

Creates a changeset for a connection history record.

Functions

changeset(history, attrs)

Creates a changeset for a connection history record.

The user_a_uuid and user_b_uuid are automatically normalized so that the lower UUID is always stored as user_a_uuid for consistent querying.