Package org.cyclos.db
Class DatabaseHistory
- java.lang.Object
-
- org.cyclos.db.DatabaseHistory
-
public class DatabaseHistory extends Object
This class returns the database history, providing access to migration scripts.
-
-
Constructor Summary
Constructors Constructor Description DatabaseHistory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists(String appVersion)Returns whether the given application version existsList<String>getApplicationVersions()Returns a list with all available application versionsList<String>getApplicationVersionsToUpgrade(String appVersion)Returns all versions which needs to be processed for upgrading since the given current version.List<Integer>getDbVersions(String appVersion)Returns all known database versions for the given application versionintgetLastDbVersion(String appVersion)Returns the last database version for the given application versionSortedMap<Integer,VersionScript>getScripts(String appVersion)Returns the scripts by versionstatic voidmain(String[] args)StringnormalizeVersion(String appVersion)Normalizes the given version number to the number of parts handled by the database history scheme, that is, 3
-
-
-
Field Detail
-
DIRECTORY
public static final String DIRECTORY
- See Also:
- Constant Field Values
-
-
Method Detail
-
exists
public boolean exists(String appVersion)
Returns whether the given application version exists
-
getApplicationVersions
public List<String> getApplicationVersions()
Returns a list with all available application versions
-
getApplicationVersionsToUpgrade
public List<String> getApplicationVersionsToUpgrade(String appVersion)
Returns all versions which needs to be processed for upgrading since the given current version. The current version will be returned as well.
-
getDbVersions
public List<Integer> getDbVersions(String appVersion)
Returns all known database versions for the given application version
-
getLastDbVersion
public int getLastDbVersion(String appVersion)
Returns the last database version for the given application version
-
getScripts
public SortedMap<Integer,VersionScript> getScripts(String appVersion)
Returns the scripts by version
-
-