Mercurial > hg > orthanc-databases
comparison MySQL/Plugins/MySQLIndex.cpp @ 238:f033cc039264
new table: "ServerProperties"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 08 Apr 2021 19:33:36 +0200 |
parents | 35598014f140 |
children | a063bbf10a3e |
comparison
equal
deleted
inserted
replaced
237:35598014f140 | 238:f033cc039264 |
---|---|
265 if (revision != 5) | 265 if (revision != 5) |
266 { | 266 { |
267 LOG(ERROR) << "MySQL plugin is incompatible with database schema revision: " << revision; | 267 LOG(ERROR) << "MySQL plugin is incompatible with database schema revision: " << revision; |
268 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database); | 268 throw Orthanc::OrthancException(Orthanc::ErrorCode_Database); |
269 } | 269 } |
270 } | 270 |
271 | 271 |
272 { | |
273 // New in release 4.0 to deal with multiple writers | |
274 DatabaseManager::Transaction t(manager, TransactionType_ReadWrite); | |
275 | |
276 if (!t.DoesTableExist("ServerProperties")) | |
277 { | |
278 t.ExecuteMultiLines("CREATE TABLE ServerProperties(server VARCHAR(64) NOT NULL, " | |
279 "property INTEGER, value TEXT, PRIMARY KEY(server, property))"); | |
280 } | |
281 | |
282 t.Commit(); | |
283 } | |
284 } | |
285 | |
286 | |
272 /** | 287 /** |
273 * WARNING: This lock must be acquired after | 288 * WARNING: This lock must be acquired after |
274 * "MYSQL_LOCK_DATABASE_SETUP" is released. Indeed, in MySQL < | 289 * "MYSQL_LOCK_DATABASE_SETUP" is released. Indeed, in MySQL < |
275 * 5.7, it is impossible to acquire more than one lock at a time, | 290 * 5.7, it is impossible to acquire more than one lock at a time, |
276 * as calling "SELECT GET_LOCK()" releases all the | 291 * as calling "SELECT GET_LOCK()" releases all the |