# HG changeset patch # User Sebastien Jodogne # Date 1548252870 -3600 # Node ID 3f31e3fa5114ea46f2a5cb648bd158deb6cd3efa # Parent 57c0138d456e1de14b2d2174aae8af62ee8a8528 MySQL: metadata can store larger values diff -r 57c0138d456e -r 3f31e3fa5114 MySQL/Plugins/MySQLIndex.cpp --- a/MySQL/Plugins/MySQLIndex.cpp Tue Jan 22 17:21:32 2019 +0100 +++ b/MySQL/Plugins/MySQLIndex.cpp Wed Jan 23 15:14:30 2019 +0100 @@ -140,7 +140,20 @@ SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); } - if (revision != 3) + if (revision == 3) + { + // Reconfiguration of "Metadata" from TEXT type (up to 64KB) + // to the LONGTEXT type (up to 4GB). This might be important + // for applications such as the Osimis Web viewer that stores + // large amount of metadata. + // http://book.orthanc-server.com/faq/features.html#central-registry-of-metadata-and-attachments + db->Execute("ALTER TABLE Metadata MODIFY value LONGTEXT", false); + + revision = 4; + SetGlobalIntegerProperty(*db, t, Orthanc::GlobalProperty_DatabasePatchLevel, revision); + } + + if (revision != 4) { LOG(ERROR) << "MySQL plugin is incompatible with database schema revision: " << revision; throw Orthanc::OrthancException(Orthanc::ErrorCode_Database);