# `AshEvents.Events.Changes.ApplyReplayPrimaryKey`
[🔗](https://github.com/ash-project/ash_events/blob/v0.7.0/lib/events/changes/apply_replay_primary_key.ex#L5)

A change that runs FIRST during replay to set the primary key.

This ensures the correct ID is available for any changes that need to reference it
(like managed relationships that create related records).

Other changed attributes are handled by ApplyChangedAttributes which runs last.

# `atomic`

# `change`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
