mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 10:57:41 +02:00
TableWithBranchSupport: do not branchify relations
This commit is contained in:
parent
ae0992f196
commit
b35b6b84cc
@ -22,12 +22,16 @@ trait TableWithBranchSupport
|
|||||||
$result = [
|
$result = [
|
||||||
'uuid' => 'COALESCE(o.uuid, bo.uuid)'
|
'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) {
|
foreach ($columns as $alias => $column) {
|
||||||
if (substr($column, 0, 2) === 'o.' && ! in_array($column, $ignore)) {
|
if (substr($column, 0, 2) === 'o.' && ! in_array($column, $ignore)) {
|
||||||
// bo.column, o.column
|
// bo.column, o.column
|
||||||
$column = "COALESCE(b$column, $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:
|
// Used in Service Tables:
|
||||||
if ($column === 'h.object_name' && $alias = 'host') {
|
if ($column === 'h.object_name' && $alias = 'host') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user