-
Notifications
You must be signed in to change notification settings - Fork 245
Versioning
#Versioning Your Database with RoundhousE
##Version The Way You Want Versioning is very important and done exactly how you want to do versioning. RH has a convention that you provide it the version number through an XML file (and an xpath to the version) or a DLL file (uses the file version). The other thing it wants to know is the repository path (if provided). It is preferred that you version based on the same way you version your code. In this sample, versioning is done with source control revisions as the last number in the version. Notice that RH is looking at an XML file and XPath for versioning. As mentioned it can also use a DLL. It is intelligent enough to know the difference based on the file name from the configuration.
It is recommended you use a versioning technique that applies globally to all instances of your databases.
###Defaults When you supply nothing:
- VersionFile = "_BuildInfo.xml"
- VerionXPath = "//buildInfo/version"
###Sequence Number Based - Non-Global
SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob
If you give RoundhousE nothing for versioning (and it doesn't find the default file), it will version by a number. It holds no representation of a true version and is not global, but it's a start.
The method it uses here is the method that you see in other migration tools where a number increases by one every time you migrate. The method RH uses is the same method it does for the others, you just look at id instead of version.
In the image above you notice how version is always zero. The id increments up though. When using sequence-based versioning, you look only at the ID.
SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob /vf="up/*.sql" /r="http://roundhouse.googlecode.com/svn"
SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob /vf="_BuildInfo.xml" /vx="//buildInfo/version" /r="http://roundhouse.googlecode.com/svn"
==================================================
Versioning
==================================================
Attempting to resolve version from C:\code\roundhouse\code_drop\sample\deployment\_BuildInfo.xml using //buildInfo/version.
Found version 0.8.0.305 from C:\code\roundhouse\code_drop\sample\deployment\_BuildInfo.xml.
Migrating TestRoundhousE from version 0 to 0.8.0.305.
Versioning TestRoundhousE database with version 0.8.0.305 based on http://roundhouse.googlecode.com/svn.
###DLL Based - Global
SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob /vf="%DIR%..\..\code_drop\RoundhousE\lib\roundhouse.dll" /r="http://roundhouse.googlecode.com/svn"
==================================================
Versioning
==================================================
Attempting to resolve assembly file version from C:\code\roundhouse\code_drop\RoundhousE\lib\roundhouse.dll.
Found version 0.8.0.305 from C:\code\roundhouse\code_drop\RoundhousE\lib\roundhouse.dll.
Migrating TestRoundhousE from version 0 to 0.8.0.305.
Versioning TestRoundhousE database with version 0.8.0.305 based on http://roundhouse.googlecode.com/svn.
##Version Table Below is an example of the version table.