changeset 109:3f31e3fa5114

MySQL: metadata can store larger values
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Jan 2019 15:14:30 +0100
parents 57c0138d456e
children 441a472bfd93
files MySQL/Plugins/MySQLIndex.cpp
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);