TableWithBranchSupport: do not branchify relations

This commit is contained in:
Thomas Gelf 2022-09-20 12:03:00 +02:00
parent ae0992f196
commit b35b6b84cc

View File

@ -22,12 +22,16 @@ trait TableWithBranchSupport
$result = [
'uuid' => 'COALESCE(o.uuid, bo.uuid)'
];
$ignore = ['o.id'];
$ignore = ['o.id', 'os.id', 'o.service_set_id', 'os.host_id'];
foreach ($columns as $alias => $column) {
if (substr($column, 0, 2) === 'o.' && ! in_array($column, $ignore)) {
// bo.column, o.column
$column = "COALESCE(b$column, $column)";
}
if (substr($column, 0, 3) === 'os.' && ! in_array($column, $ignore)) {
// bo.column, o.column
$column = "COALESCE(b$column, $column)";
}
// Used in Service Tables:
if ($column === 'h.object_name' && $alias = 'host') {