fix(MainDb): do not update module version if it is unchanged

This commit is contained in:
Ronan Abhamon 2017-12-19 14:24:06 +01:00
parent 1cf7027eb1
commit e93ed1cc3f

View file

@ -1033,6 +1033,10 @@ static constexpr string &blobToString (string &in) {
}
void MainDbPrivate::updateModuleVersion (const string &name, unsigned int version) {
unsigned int oldVersion = getModuleVersion(name);
if (oldVersion == version)
return;
soci::session *session = dbSession.getBackendSession<soci::session>();
*session << "REPLACE INTO db_module_version (name, version) VALUES (:name, :version)",
soci::use(name), soci::use(version);