Db: add countActivitiesSinceLastDeployedConfig

Forgot to push this one, sorry.
This commit is contained in:
Thomas Gelf 2016-02-18 13:46:24 +01:00
parent 9b8415cccd
commit ea8da2172f

View File

@ -24,6 +24,19 @@ class Db extends DbConnection
return $this->getDbAdapter(); return $this->getDbAdapter();
} }
public function countActivitiesSinceLastDeployedConfig()
{
$query = 'SELECT COUNT(*) FROM director_activity_log WHERE id > ('
. ' SELECT id FROM director_activity_log WHERE checksum = ('
. ' SELECT last_activity_checksum FROM director_generated_config WHERE checksum = ('
. ' SELECT config_checksum FROM director_deployment_log ORDER by id desc limit 1'
. ' )'
. ' )'
. ')';
return (int) $this->db()->fetchOne($query);
}
public function getMasterZoneName() public function getMasterZoneName()
{ {
return $this->getSetting('master_zone', 'master'); return $this->getSetting('master_zone', 'master');