diff OrthancServer/DatabaseWrapper.cpp @ 1189:6b9b02a16e99 db-changes

NewChildInstance change type
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Sep 2014 17:02:28 +0200
parents 5b2d8c280ac2
children 1169528a9a5f
line wrap: on
line diff
--- a/OrthancServer/DatabaseWrapper.cpp	Thu Sep 25 16:42:19 2014 +0200
+++ b/OrthancServer/DatabaseWrapper.cpp	Thu Sep 25 17:02:28 2014 +0200
@@ -652,19 +652,17 @@
                                   ResourceType resourceType,
                                   const std::string& publicId)
   {
-    if (changeType == ChangeType_Deleted)
+    if (changeType <= ChangeType_INTERNAL_LastLogged)
     {
-      throw OrthancException(ErrorCode_ParameterOutOfRange);
-    }
-
-    const boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
+      const boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
 
-    SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO Changes VALUES(NULL, ?, ?, ?, ?)");
-    s.BindInt(0, changeType);
-    s.BindInt64(1, internalId);
-    s.BindInt(2, resourceType);
-    s.BindString(3, boost::posix_time::to_iso_string(now));
-    s.Run();
+      SQLite::Statement s(db_, SQLITE_FROM_HERE, "INSERT INTO Changes VALUES(NULL, ?, ?, ?, ?)");
+      s.BindInt(0, changeType);
+      s.BindInt64(1, internalId);
+      s.BindInt(2, resourceType);
+      s.BindString(3, boost::posix_time::to_iso_string(now));
+      s.Run();
+    }
 
     listener_.SignalChange(changeType, resourceType, publicId);
   }