# HG changeset patch # User Sebastien Jodogne # Date 1433409825 -7200 # Node ID cbf322c3c93270c175497d0d1675f62515beac7c # Parent 31f2fc2d56eee64bc1cedb3e4a3983b88f9cf62c check db version diff -r 31f2fc2d56ee -r cbf322c3c932 CMakeLists.txt --- a/CMakeLists.txt Fri May 29 11:32:45 2015 +0200 +++ b/CMakeLists.txt Thu Jun 04 11:23:45 2015 +0200 @@ -52,7 +52,7 @@ # Check that the Orthanc SDK headers are available or download them if (STATIC_BUILD) - set(ORTHANC_SDK_URL "http://orthanc.googlecode.com/hg-history/Orthanc-0.8.6") + set(ORTHANC_SDK_URL "http://orthanc.googlecode.com/hg-history/Orthanc-0.9.0") file(MAKE_DIRECTORY ${AUTOGENERATED_DIR}/orthanc) file(DOWNLOAD "${ORTHANC_SDK_URL}/Plugins/Include/OrthancCPlugin.h" "${AUTOGENERATED_DIR}/orthanc/OrthancCPlugin.h" SHOW_PROGRESS) diff -r 31f2fc2d56ee -r cbf322c3c932 Core/Configuration.cpp --- a/Core/Configuration.cpp Fri May 29 11:32:45 2015 +0200 +++ b/Core/Configuration.cpp Thu Jun 04 11:23:45 2015 +0200 @@ -202,5 +202,4 @@ return false; } - } diff -r 31f2fc2d56ee -r cbf322c3c932 IndexPlugin/Plugin.cpp --- a/IndexPlugin/Plugin.cpp Fri May 29 11:32:45 2015 +0200 +++ b/IndexPlugin/Plugin.cpp Thu Jun 04 11:23:45 2015 +0200 @@ -48,6 +48,17 @@ return -1; } + /* Check the expected version of the database */ + if (OrthancPluginGetExpectedDatabaseVersion(context_) != 5) + { + char info[1024]; + sprintf(info, "This database plugin is incompatible with your version of Orthanc " + "expecting the DB schema version %d, but this plugin is compatible with version 5", + OrthancPluginGetExpectedDatabaseVersion(context_)); + OrthancPluginLogError(context_, info); + return -1; + } + OrthancPluginSetDescription(context_, "Stores the Orthanc index into a PostgreSQL database.");