comparison Plugins/Samples/DatabasePlugin/Database.cpp @ 1673:0bbcfd9695e5 db-changes

UpgradeDatabase in the sample plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 02 Oct 2015 13:26:05 +0200
parents 4c5a85c3ff43
children 3926e6317a43
comparison
equal deleted inserted replaced
1672:4c5a85c3ff43 1673:0bbcfd9695e5
538 538
539 539
540 void Database::UpgradeDatabase(uint32_t targetVersion, 540 void Database::UpgradeDatabase(uint32_t targetVersion,
541 OrthancPluginStorageArea* storageArea) 541 OrthancPluginStorageArea* storageArea)
542 { 542 {
543 } 543 if (targetVersion == 6)
544 {
545 OrthancPluginErrorCode code = OrthancPluginReconstructMainDicomTags(GetOutput().GetContext(), storageArea,
546 OrthancPluginResourceType_Study);
547 if (code == OrthancPluginErrorCode_Success)
548 {
549 code = OrthancPluginReconstructMainDicomTags(GetOutput().GetContext(), storageArea,
550 OrthancPluginResourceType_Series);
551 }
552
553 if (code != OrthancPluginErrorCode_Success)
554 {
555 throw OrthancPlugins::DatabaseException(code);
556 }
557
558 base_.SetGlobalProperty(Orthanc::GlobalProperty_DatabaseSchemaVersion, "6");
559 }
560 }