Package org.flywaydb.core.api
Class MigrationVersion
- java.lang.Object
-
- org.flywaydb.core.api.MigrationVersion
-
- All Implemented Interfaces:
Comparable<MigrationVersion>
public final class MigrationVersion extends Object implements Comparable<MigrationVersion>
A version of a migration.- Author:
- Axel Fontaine
-
-
Field Summary
Fields Modifier and Type Field Description static MigrationVersionCURRENTCurrent version.static MigrationVersionEMPTYVersion for an empty schema.static MigrationVersionLATESTLatest version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(MigrationVersion o)booleanequals(Object o)static MigrationVersionfromVersion(String version)Factory for creating a MigrationVersion from a version StringStringgetVersion()inthashCode()StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final MigrationVersion EMPTY
Version for an empty schema.
-
LATEST
public static final MigrationVersion LATEST
Latest version.
-
CURRENT
public static final MigrationVersion CURRENT
Current version. Only a marker. For the real version use Flyway.info().current() instead.
-
-
Method Detail
-
fromVersion
public static MigrationVersion fromVersion(String version)
Factory for creating 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
public String toString()
-
getVersion
public String getVersion()
- Returns:
- Numeric version as String
-
compareTo
public int compareTo(MigrationVersion o)
- Specified by:
compareToin interfaceComparable<MigrationVersion>
-
-