Mercurial > hg > orthanc-databases
comparison MySQL/Plugins/MySQLIndex.cpp @ 366:cd9521e04249 attach-custom-data
DatabaseBackendAdapterV4: added support for customData + revision when not already done
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 15 Sep 2022 18:12:34 +0200 |
parents | eb0b04c10bc4 |
children | f18e46d7dbf8 |
comparison
equal
deleted
inserted
replaced
365:7671fa7f099e | 366:cd9521e04249 |
---|---|
292 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); | 292 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); |
293 | 293 |
294 t.Commit(); | 294 t.Commit(); |
295 } | 295 } |
296 | 296 |
297 if (revision != 6) | 297 if (revision == 6) |
298 { | |
299 DatabaseManager::Transaction t(manager, TransactionType_ReadWrite); | |
300 | |
301 // Install revision and customData extension | |
302 std::string query; | |
303 | |
304 Orthanc::EmbeddedResources::GetFileResource | |
305 (query, Orthanc::EmbeddedResources::MYSQL_INSTALL_REVISION_AND_CUSTOM_DATA); | |
306 | |
307 // Need to escape arobases: Don't use "t.GetDatabaseTransaction().ExecuteMultiLines()" here | |
308 db.ExecuteMultiLines(query, true); | |
309 | |
310 revision = 7; | |
311 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); | |
312 | |
313 t.Commit(); | |
314 } | |
315 | |
316 if (revision != 7) | |
298 { | 317 { |
299 LOG(ERROR) << "MySQL plugin is incompatible with database schema revision: " << revision; | 318 LOG(ERROR) << "MySQL plugin is incompatible with database schema revision: " << revision; |
300 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database); | 319 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database); |
301 } | 320 } |
302 } | 321 } |