Skip to content

Commit

Permalink
[releng] Allow any kind of migration towards current version.
Browse files Browse the repository at this point in the history
Change-Id: I3e78602ba8457a2c5b99a34c8b3f9be7f1a7fc08
Signed-off-by: Erwann Traisnel <erwann.traisnel@obeo.fr>
  • Loading branch information
etraisnel2 authored and pdulth committed Jul 12, 2023
1 parent 7c3ea04 commit b4ba425
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ public void postMigrationExecute(ExecutionManager executionManager, ResourceSet
* @see See also org.polarsys.capella.core.af.integration.CapellaMetadataProvider.isMigrationRequired
*/
private boolean isMigrationPossible(Version fileVersion, Version currentVersion) {
boolean sameMajor = (currentVersion.getMajor() == fileVersion.getMajor());

if (sameMajor) {
// Allow migration from <MAJOR>.x to <MAJOR>.y
if (fileVersion.getMajor() == 0)
return false;
if (fileVersion.getMajor() == 1)
return fileVersion.getMinor() == 4;
if (fileVersion.getMajor() < currentVersion.getMajor())
return true;
}

// Allow migration from 1.4.x to 6.x and from 5.x to 6.x
return (currentVersion.getMajor() == 6) && (fileVersion.getMajor() == 5 || (fileVersion.getMajor() == 1 && fileVersion.getMinor() == 4));
if (fileVersion.getMajor() == currentVersion.getMajor())
return fileVersion.getMinor() <= currentVersion.getMinor();
return false;
}
}

0 comments on commit b4ba425

Please sign in to comment.