Skip to content

Commit

Permalink
add-some-mssing-reltions
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Nov 14, 2024
1 parent e8f1892 commit e96f2a4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icingadb/Model/DependencyNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public function createBehaviors(Behaviors $behaviors): void
]));
$behaviors->add(new ReRoute([
'child' => 'to.from',
'parent' => 'from.to'
'parent' => 'from.to',
'hostgroup' => 'host.hostgroup',
'servicegroup' => 'service.servicegroup'
]));
}

Expand Down
1 change: 1 addition & 0 deletions library/Icingadb/Model/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public function createRelations(Relations $relations)
$relations->hasMany('notification', Notification::class)->setJoinType('LEFT');
$relations->hasMany('notification_history', NotificationHistory::class);
$relations->hasMany('service', Service::class)->setJoinType('LEFT');
$relations->hasOne('dependency_node', DependencyNode::class)->setJoinType('LEFT');

$relations->belongsToMany('from', DependencyEdge::class)
->setTargetCandidateKey('from_node_id')
Expand Down
1 change: 1 addition & 0 deletions library/Icingadb/Model/RedundancyGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function createRelations(Relations $relations): void
->setJoinType('LEFT');

$relations->hasMany('dependency', Dependency::class);
$relations->hasOne('dependency_node', DependencyNode::class)->setJoinType('LEFT');

$relations->belongsToMany('from', DependencyEdge::class)
->setTargetCandidateKey('from_node_id')
Expand Down
1 change: 1 addition & 0 deletions library/Icingadb/Model/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public function createRelations(Relations $relations)
$relations->hasMany('history', History::class);
$relations->hasMany('notification', Notification::class)->setJoinType('LEFT');
$relations->hasMany('notification_history', NotificationHistory::class);
$relations->hasOne('dependency_node', DependencyNode::class)->setJoinType('LEFT');

$relations->belongsToMany('from', DependencyEdge::class)
->setTargetCandidateKey('from_node_id')
Expand Down

0 comments on commit e96f2a4

Please sign in to comment.