Mercurial > hg > orthanc-databases
comparison MySQL/Plugins/MySQLIndex.cpp @ 290:2790bafe3b3d
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Jun 2021 08:23:27 +0200 |
parents | 0868500060f3 |
children | 3a52e27a2d80 |
comparison
equal
deleted
inserted
replaced
289:0868500060f3 | 290:2790bafe3b3d |
---|---|
136 * don't forget to add "IF NOT EXISTS" if some table must be | 136 * don't forget to add "IF NOT EXISTS" if some table must be |
137 * created below this point (in order to recover from failed | 137 * created below this point (in order to recover from failed |
138 * transaction). | 138 * transaction). |
139 **/ | 139 **/ |
140 | 140 |
141 int version = 0; | |
142 | |
143 { | 141 { |
144 DatabaseManager::Transaction t(manager, TransactionType_ReadWrite); | 142 DatabaseManager::Transaction t(manager, TransactionType_ReadWrite); |
145 | 143 |
146 // This is the last table to be created | 144 // This is the last table to be created |
147 if (!t.GetDatabaseTransaction().DoesTableExist("PatientRecyclingOrder")) | 145 if (!t.GetDatabaseTransaction().DoesTableExist("PatientRecyclingOrder")) |
153 // This is the last item to be created | 151 // This is the last item to be created |
154 if (!t.GetDatabaseTransaction().DoesTriggerExist("PatientAdded")) | 152 if (!t.GetDatabaseTransaction().DoesTriggerExist("PatientAdded")) |
155 { | 153 { |
156 ThrowCannotCreateTrigger(); | 154 ThrowCannotCreateTrigger(); |
157 } | 155 } |
156 | |
157 int version = 0; | |
158 | 158 |
159 if (!LookupGlobalIntegerProperty(version, manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion)) | 159 if (!LookupGlobalIntegerProperty(version, manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion)) |
160 { | 160 { |
161 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion, expectedVersion); | 161 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion, expectedVersion); |
162 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, 1); | 162 SetGlobalIntegerProperty(manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabasePatchLevel, 1); |