Package org.flywaydb.core.api
Class MigrationVersion
java.lang.Object
org.flywaydb.core.api.MigrationVersion
- All Implemented Interfaces:
Comparable<MigrationVersion>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MigrationVersionCurrent version.static final MigrationVersionVersion for an empty schema.static final MigrationVersionLatest version.static final MigrationVersionNext version. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic MigrationVersionfromVersion(String version) Create a MigrationVersion from a version String.getMajor()getName()The raw, unprocessed text to represent the version.inthashCode()booleanConvenience method for quickly checking whether this version is at least as new as this other version.booleanisMajorNewerThan(String otherVersion) Convenience method for quickly checking whether this major version is newer than this other major version.booleanisNewerThan(String otherVersion) Convenience method for quickly checking whether this version is newer than this other version.booleanisNewerThan(MigrationVersion otherVersion) Convenience method for quickly checking whether this version is newer than this other version.booleanIs this version an internal predefined version?toString()
-
Field Details
-
EMPTY
Version for an empty schema. -
LATEST
Latest version. -
CURRENT
Current version. Only a marker. For the real version use Flyway.info().current() instead. -
NEXT
Next version.
-
-
Method Details
-
fromVersion
Create a MigrationVersion from a version String.- Parameters:
version- The version String. The valuecurrentwill be interpreted as MigrationVersion.CURRENT, a marker for the latest version that has been applied to the database.- Returns:
- The MigrationVersion
-
toString
-
getVersion
- Returns:
- Numeric version as String
-
getName
-
equals
-
hashCode
public int hashCode() -
isAtLeast
Convenience method for quickly checking whether this version is at least as new as this other version.- Parameters:
otherVersion- The other version.- Returns:
trueif this version is equal or newer,falseif it is older.
-
isNewerThan
Convenience method for quickly checking whether this version is newer than this other version.- Parameters:
otherVersion- The other version.- Returns:
trueif this version is newer,falseif it is not.
-
isNewerThan
Convenience method for quickly checking whether this version is newer than this other version.- Parameters:
otherVersion- The other version.- Returns:
trueif this version is newer,falseif it is not.
-
isMajorNewerThan
Convenience method for quickly checking whether this major version is newer than this other major version.- Parameters:
otherVersion- The other version.- Returns:
trueif this major version is newer,falseif it is not.
-
getMajor
- Returns:
- The major version.
-
getMajorAsString
- Returns:
- The major version as a string.
-
getMinorAsString
- Returns:
- The minor version as a string.
-
compareTo
- Specified by:
compareToin interfaceComparable<MigrationVersion>
-
getRawVersion
The raw, unprocessed text to represent the version. -
isPredefined
public boolean isPredefined()Is this version an internal predefined version?
-