SyncJounral: add an index on the error blacklist table
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 11 Feb 2016 13:38:38 +0000 (14:38 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Thu, 11 Feb 2016 13:38:38 +0000 (14:38 +0100)
https://github.com/owncloud/enterprise/issues/1035

src/libsync/syncjournaldb.cpp

index d492efa07c61eb7b10ff0b569d5a02d531e37037..e88bd40b6a0c24e9c13d4464643b902978d9ecec 100644 (file)
@@ -613,6 +613,13 @@ bool SyncJournalDb::updateErrorBlacklistTableStructure()
         commitInternal("update database structure: add lastTryTime, ignoreDuration cols");
     }
 
+    SqlQuery query(_db);
+    query.prepare("CREATE INDEX IF NOT EXISTS blacklist_index ON blacklist(path collate nocase);");
+    if( !query.exec()) {
+        sqlFail("updateErrorBlacklistTableStructure: create index blacklit", query);
+        re = false;
+    }
+
     return re;
 }