Преглед на файлове

Fixed non-unique primary key in ip_ports table

Stefan Schmidt преди 6 години
родител
ревизия
23ccc7d823
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      code_boost/src/cxx/statistics_db.cpp
  2. 1 1
      code_boost/src/cxx/statistics_db.h

+ 1 - 1
code_boost/src/cxx/statistics_db.cpp

@@ -264,7 +264,7 @@ void statistics_db::writeStatisticsPorts(const std::unordered_map<ipAddress_inOu
                 "byteCount REAL,"
                 "portProtocol TEXT COLLATE NOCASE,"
                 "portService TEXT COLLATE NOCASE,"
-                "PRIMARY KEY(ipAddress,portDirection,portNumber));";
+                "PRIMARY KEY(ipAddress,portDirection,portNumber,portProtocol));";
         db->exec(createTable);
         SQLite::Statement query(*db, "INSERT INTO ip_ports VALUES (?, ?, ?, ?, ?, ?, ?)");
         for (auto it = portsStatistics.begin(); it != portsStatistics.end(); ++it) {

+ 1 - 1
code_boost/src/cxx/statistics_db.h

@@ -22,7 +22,7 @@ public:
     /*
      * Database version: Increment number on every change in the C++ code!
      */
-    static const int DB_VERSION = 6;
+    static const int DB_VERSION = 7;
 
     /*
      * Methods for writing values into database