Seats keep their former names, so a rename breaks nothing (ADR 0122, phase 2)
Phase 1 made the set data; a rename still broke every reference to the old name. This adds the stable identity: a seat's canonical name changes and its old name becomes an alias that resolves to it forever. SeatNamed and the holder and display matching resolve a name (former or current) to its seat, so a manifest's claim, a held record, the git-seat lookup and the build machine's embedded set all go on working unchanged after a rename. seat_alias table (migration 0035), inventory Aliases/RenameSeat, openInventory loads them, and a 'seat rename <from> <to>' command does the whole thing — one operation, no rebuild, no re-registration, no freeze. Behaviour-neutral until a seat is renamed. Validated against postgres.
This commit is contained in:
@@ -102,6 +102,10 @@ func openInventory(ctx context.Context) (*inventory.Inventory, error) {
|
||||
if seats, err := inv.Seats(ctx); err == nil {
|
||||
catalogue.UseSeats(seats)
|
||||
}
|
||||
// And the former names, so a reference to a seat's old name resolves after a rename (ADR 0122).
|
||||
if aliases, err := inv.Aliases(ctx); err == nil {
|
||||
catalogue.UseAliases(aliases)
|
||||
}
|
||||
return inv, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user