Constraint violation when swapping two unique attributes