AshEvents.Events.Changes.ApplyReplayPrimaryKey (ash_events v0.7.0)

Copy Markdown View Source

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.

Summary

Functions

atomic(changeset, opts, context)

Callback implementation for Ash.Resource.Change.atomic/3.

change(cs, opts, ctx)

Callback implementation for Ash.Resource.Change.change/3.