@ Override public boolean upgrade ( ) { int schemaVersion = versionService . getSchemaVersion ( ) ; if ( schemaVersion < 31 ) { throw new UnsupportedOperationException ( "Upgrading from schema version below 31 is not supported" ) ; } if ( schemaVersion < versionService . getAppVersion ( ) ) { LOG . info ( "Metadata version:{}, current version:{} upgrade needed" , schemaVersion , versionService . getAppVersion ( ) ) ; upgrades . stream ( ) . filter ( upgrade -> upgrade . getFromVersion ( ) >= schemaVersion ) . forEach ( this :: runUpgrade ) ; versionService . setSchemaVersion ( versionService . getAppVersion ( ) ) ; LOG . info ( "Metadata upgrade done." ) ; return true ; } else { LOG . debug ( "Metadata version:{}, current version:{} upgrade not needed" , schemaVersion , versionService . getAppVersion ( ) ) ; return false ; } }
Executes MOLGENIS MetaData version upgrades .