[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: DirectorDeploymentLog: use predefined aliases...

git at icinga.org git at icinga.org
Fri Jul 22 13:55:47 CEST 2016


Module: icingaweb2-module-director
Branch: fiddle/mfrosch
Commit: 1555d049f2a00ef0e7d2ccebbe24f863b0079678
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=1555d049f2a00ef0e7d2ccebbe24f863b0079678

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Jul 21 13:12:45 2016 +0200

DirectorDeploymentLog: use predefined aliases...

...to avoid problems with too much intelligence in deeper db
abstraction layers

---

 library/Director/Objects/DirectorDeploymentLog.php |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/library/Director/Objects/DirectorDeploymentLog.php b/library/Director/Objects/DirectorDeploymentLog.php
index a81dc87..3cbf6ff 100644
--- a/library/Director/Objects/DirectorDeploymentLog.php
+++ b/library/Director/Objects/DirectorDeploymentLog.php
@@ -75,8 +75,10 @@ class DirectorDeploymentLog extends DbObject
     {
         $db = $connection->getDbAdapter();
         $query = $db->select()
-            ->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum')))
-            ->where('stage_name = ?');
+            ->from(
+                array('l' => 'director_deployment_log'),
+                array('c' => $connection->dbHexFunc('l.config_checksum'))
+            )->where('l.stage_name = ?');
 
         return $db->fetchOne($query, $stage);
     }
@@ -85,8 +87,8 @@ class DirectorDeploymentLog extends DbObject
     {
         $db = $connection->getDbAdapter();
         $query = $db->select()->from(
-            'director_deployment_log',
-            array('id' => 'MAX(id)')
+            array('l' => 'director_deployment_log'),
+            array('id' => 'MAX(l.id)')
         );
 
         return static::load($db->fetchOne($query), $connection);



More information about the icinga-checkins mailing list