com.xpn.xwiki.store.migration
Class XWikiDBVersion
java.lang.Object
com.xpn.xwiki.store.migration.XWikiDBVersion
- All Implemented Interfaces:
- Comparable<XWikiDBVersion>
public class XWikiDBVersion
- extends Object
- implements Comparable<XWikiDBVersion>
Stores XWiki's data version in the database. Used to find out which migrations to execute based on the current data
version in the Database (each migration says which minimal version it requires to execute).
The version scheme in the past was to use the SVN revision number of the commit of the migrator but since we've now
moved to Git we're now using an integer matching the current XWiki version and allowing for a range of 1000
migrations. So if you're writing the first migrator for version 5.2 of XWiki then the version will be 52000. If
you're writing the 2nd migration for XWiki 5.2 then its version would be 52001, etc.
- Version:
- $Id: 6372312b9ffe044f6eda06c0807b88995a016f98 $
XWikiDBVersion
public XWikiDBVersion()
- Default constructor. It is need for Hibernate.
XWikiDBVersion
public XWikiDBVersion(int version)
- Parameters:
version
- - data version
getVersion
public int getVersion()
- Returns:
- data version
setVersion
protected void setVersion(int version)
- Parameters:
version
- - data version
compareTo
public int compareTo(XWikiDBVersion o)
- Specified by:
compareTo
in interface Comparable<XWikiDBVersion>
toString
public String toString()
- Overrides:
toString
in class Object
increment
public XWikiDBVersion increment()
- Returns:
- next version
Copyright © 2004–2014 XWiki. All rights reserved.