# HG changeset patch # User Sebastien Jodogne # Date 1446117878 -3600 # Node ID 63187f3924168622e629e8faf4dead4915114c7f # Parent 2605ebf75cf8253d6f29d3065990b863b9dfaeee fix diff -r 2605ebf75cf8 -r 63187f392416 IndexPlugin/PostgreSQLWrapper.cpp --- a/IndexPlugin/PostgreSQLWrapper.cpp Thu Oct 29 12:01:30 2015 +0100 +++ b/IndexPlugin/PostgreSQLWrapper.cpp Thu Oct 29 12:24:38 2015 +0100 @@ -1504,6 +1504,10 @@ if (version == 5 && targetVersion == 6) { + version_ = 6; // Must be here, otherwise calls to + // SetMainDicomTag() during the reconstruction of + // the DICOM tags will fail as the column type + // has been altered connection_->Execute("ALTER TABLE MainDicomTags ALTER COLUMN value TYPE TEXT"); connection_->Execute("ALTER TABLE DicomIdentifiers ALTER COLUMN value TYPE TEXT"); OrthancPluginReconstructMainDicomTags(context_, storageArea, OrthancPluginResourceType_Patient); @@ -1512,7 +1516,6 @@ OrthancPluginReconstructMainDicomTags(context_, storageArea, OrthancPluginResourceType_Instance); connection_->Execute("DELETE FROM GlobalProperties WHERE property=1"); connection_->Execute("INSERT INTO GlobalProperties VALUES (1, '6');"); - version_ = 6; return; // Success }