pub async fn mark_superseded(
conn: &mut PgConnection,
id: Uuid,
superseded_by_id: Uuid,
) -> ModelResult<()>Expand description
Points an old attempt at the newer one that replaced it. The old row keeps its state and
terminal_at: it really was registered.
superseded_by_id may name a row that does not exist yet, as long as it is inserted before the
caller’s transaction commits: the foreign key is deferred, which is what lets the successor take
the completion’s one live slot without the old attempt ever pointing at itself.