DB IDO: Really do not clear downtimes on checkable upsert

refs #12258
refs #12288
This commit is contained in:
Michael Friedrich 2016-08-11 17:40:35 +02:00
parent f5d5eaf344
commit d84872f075
1 changed files with 0 additions and 11 deletions

View File

@ -441,19 +441,8 @@ void DbEvents::AddDowntimes(const Checkable::Ptr& checkable)
{ {
std::set<Downtime::Ptr> downtimes = checkable->GetDowntimes(); std::set<Downtime::Ptr> downtimes = checkable->GetDowntimes();
/* Ensure to delete all downtimes and then insert any or none.
* We must purge obsolete downtimes in the database at all cost. */
std::vector<DbQuery> queries; std::vector<DbQuery> queries;
DbQuery query1;
query1.Table = "scheduleddowntime";
query1.Type = DbQueryDelete;
query1.Category = DbCatDowntime;
query1.WhereCriteria = new Dictionary();
query1.WhereCriteria->Set("object_id", checkable);
queries.push_back(query1);
BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) { BOOST_FOREACH(const Downtime::Ptr& downtime, downtimes) {
AddDowntimeInternal(queries, downtime, false); AddDowntimeInternal(queries, downtime, false);
} }