Try the following loop:
// create an array to hold the new schema
$uniques = array();
// loop over all the records
foreach ($records as $record) {
$uniques[$record['unique_name']] = $record;
// remove the unique_name entry from the new array
unset($uniques[$record['unique_name']]['unique_name']);
}
You could just as easily do a hardcoded key-set within the loop, but this will have less portability if you add new indexes later on:
foreach ($records as $record) {
$uniques[$record['unique_name']] = array(
'name' => $record['name'],
'value' => $record['value']
);
}