From e2eb67c5272458e89910138a107e94f9a7f66551 Mon Sep 17 00:00:00 2001 From: raviks789 Date: Wed, 18 Dec 2024 15:32:44 +0100 Subject: [PATCH] Add column `environment_id` to the models related to the dependency feature --- library/Icingadb/Model/DependencyEdge.php | 3 +++ library/Icingadb/Model/DependencyEdgeState.php | 5 ++++- library/Icingadb/Model/DependencyNode.php | 3 +++ library/Icingadb/Model/RedundancyGroup.php | 5 ++++- library/Icingadb/Model/RedundancyGroupState.php | 3 +++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/library/Icingadb/Model/DependencyEdge.php b/library/Icingadb/Model/DependencyEdge.php index 9e67c7e05..c29b605d3 100644 --- a/library/Icingadb/Model/DependencyEdge.php +++ b/library/Icingadb/Model/DependencyEdge.php @@ -13,6 +13,7 @@ /** * Dependency edge model. * + * @property string $environment_id * @property string $to_node_id * @property string $from_node_id * @property string $display_name @@ -37,6 +38,7 @@ public function getKeyName(): array public function getColumns(): array { return [ + 'environment_id', 'to_node_id', 'from_node_id', 'display_name', @@ -47,6 +49,7 @@ public function getColumns(): array public function createBehaviors(Behaviors $behaviors): void { $behaviors->add(new Binary([ + 'environment_id', 'to_node_id', 'from_node_id', 'dependency_edge_state_id' diff --git a/library/Icingadb/Model/DependencyEdgeState.php b/library/Icingadb/Model/DependencyEdgeState.php index 41550abc6..54bbe6482 100644 --- a/library/Icingadb/Model/DependencyEdgeState.php +++ b/library/Icingadb/Model/DependencyEdgeState.php @@ -11,6 +11,7 @@ * Dependency edge state model. * * @property string $id + * @property string $environment_id * @property bool $failed */ class DependencyEdgeState extends Model @@ -28,6 +29,7 @@ public function getKeyName(): string public function getColumns(): array { return [ + 'environment_id', 'failed' ]; } @@ -42,7 +44,8 @@ public function getColumnDefinitions(): array public function createBehaviors(Behaviors $behaviors): void { $behaviors->add(new Binary([ - 'id' + 'id', + 'environment_id' ])); $behaviors->add(new BoolCast([ 'failed' diff --git a/library/Icingadb/Model/DependencyNode.php b/library/Icingadb/Model/DependencyNode.php index a63ec56c8..fa1e3a071 100644 --- a/library/Icingadb/Model/DependencyNode.php +++ b/library/Icingadb/Model/DependencyNode.php @@ -16,6 +16,7 @@ * Dependency node model. * * @property string $id + * @property string $environment_id * @property ?string $host_id * @property ?string $service_id * @property ?string $redundancy_group_id @@ -46,6 +47,7 @@ public function getColumns(): array { return [ 'id', + 'environment_id', 'host_id', 'service_id', 'redundancy_group_id', @@ -85,6 +87,7 @@ public function createBehaviors(Behaviors $behaviors): void { $behaviors->add(new Binary([ 'id', + 'environment_id', 'host_id', 'service_id', 'redundancy_group_id' diff --git a/library/Icingadb/Model/RedundancyGroup.php b/library/Icingadb/Model/RedundancyGroup.php index ad3b89f04..f1bd90150 100644 --- a/library/Icingadb/Model/RedundancyGroup.php +++ b/library/Icingadb/Model/RedundancyGroup.php @@ -16,6 +16,7 @@ * Redundancy group model. * * @property string $id + * @property string $environment_id * @property string $display_name * * @property (?RedundancyGroupState)|Query $state @@ -37,6 +38,7 @@ public function getKeyName(): string public function getColumns(): array { return [ + 'environment_id', 'display_name' ]; } @@ -51,7 +53,8 @@ public function getColumnDefinitions(): array public function createBehaviors(Behaviors $behaviors): void { $behaviors->add(new Binary([ - 'id' + 'id', + 'environment_id' ])); $behaviors->add(new ReRoute([ 'child' => 'to.from', diff --git a/library/Icingadb/Model/RedundancyGroupState.php b/library/Icingadb/Model/RedundancyGroupState.php index df30f581e..126625be2 100644 --- a/library/Icingadb/Model/RedundancyGroupState.php +++ b/library/Icingadb/Model/RedundancyGroupState.php @@ -17,6 +17,7 @@ * Redundancy group state model. * * @property string $id + * @property string $environment_id * @property string $redundancy_group_id * @property bool $failed * @property DateTime $last_state_change @@ -38,6 +39,7 @@ public function getKeyName(): string public function getColumns(): array { return [ + 'environment_id', 'redundancy_group_id', 'failed', 'last_state_change' @@ -48,6 +50,7 @@ public function createBehaviors(Behaviors $behaviors): void { $behaviors->add(new Binary([ 'id', + 'environment_id', 'redundancy_group_id' ])); $behaviors->add(new BoolCast([