Skip to main content

mark_superseded

Function mark_superseded 

Source
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.

For fixtures planting a finished replacement. The pipeline goes through mark_pending_superseded, which supersedes the row only once the new attempt is 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.