Mercurial > hg > orthanc-databases
diff MySQL/Plugins/MySQLIndex.cpp @ 221:73cc85f3d9c1
implementation of the "serverIdentifier" information for global properties
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Mar 2021 10:40:34 +0200 |
parents | ee5858d438dc |
children | 94c9908e6aca |
line wrap: on
line diff
--- a/MySQL/Plugins/MySQLIndex.cpp Mon Mar 29 16:39:20 2021 +0200 +++ b/MySQL/Plugins/MySQLIndex.cpp Tue Mar 30 10:40:34 2021 +0200 @@ -141,10 +141,10 @@ ThrowCannotCreateTrigger(); } - if (!LookupGlobalIntegerProperty(version, *db, t, Orthanc::GlobalProperty_DatabaseSchemaVersion)) + if (!LookupGlobalIntegerProperty(version, *db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion)) { - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabaseSchemaVersion, expectedVersion); - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, 1); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion, expectedVersion); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, 1); version = expectedVersion; } @@ -162,10 +162,10 @@ { MySQLTransaction t(*db, TransactionType_ReadWrite); - if (!LookupGlobalIntegerProperty(revision, *db, t, Orthanc::GlobalProperty_DatabasePatchLevel)) + if (!LookupGlobalIntegerProperty(revision, *db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel)) { revision = 1; - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); } t.Commit(); @@ -182,7 +182,7 @@ db->Execute("ALTER TABLE GlobalProperties MODIFY value LONGTEXT", false); revision = 2; - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); t.Commit(); } @@ -204,7 +204,7 @@ } revision = 3; - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); t.Commit(); } @@ -221,7 +221,7 @@ db->Execute("ALTER TABLE Metadata MODIFY value LONGTEXT", false); revision = 4; - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); t.Commit(); } @@ -238,7 +238,7 @@ db->Execute(query, true); revision = 5; - SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); + SetGlobalIntegerProperty(*db, t, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, revision); t.Commit(); }