Skip to content
ferventcoder edited this page Jun 2, 2012 · 34 revisions

#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 a TXT file (uses the file contents), 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 or a TXT file. 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. Globally means that when a database is on a particular version in stage, you can guarantee that if another database is on that same version, it has all of the same scripts applied through RH (technically it could be different based on outside influences, but through normal use it is the same as far as RH scripts applied to the database).

###Defaults When you supply nothing:

  • VersionFile = "_BuildInfo.xml"
  • VersionXPath = "//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.

Sequence Only

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.

Why is sequence number versioning non-global?

Since the number goes up every time you

Script Number Based - Non-Global - v0.8.5+ - Fixed in v0.8.6

SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob /vf="sql"

XML Based - Global

SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob /vf="_BuildInfo.xml" /vx="//buildInfo/version" /r="http://roundhouse.googlecode.com/svn"

Global Versions

==================================================
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"

Global Versions

==================================================
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.

TXT Based - Global - v0.8.6+

SET DIR=%~d0%~p0%
"%DIR%rh.exe" /d=bob /vf="%DIR%..\..\code_drop\version.txt" /r="http://roundhouse.googlecode.com/svn"

Global Versions

==================================================
Versioning
==================================================
 Attempting to resolve version from text file C:\code\roundhouse\code_drop\version.txt.
 Found version 2.30.2012.02.15.1 from C:\code\roundhouse\code_drop\version.txt.
 Migrating TestApp from version 2.29.2012.01.26.2 to 2.30.2012.02.15.1.
 Versioning TestApp database with version 2.30.2012.02.15.1 based on http://roundhouse.googlecode.com/svn.

##Version Table Below is an example of the version table.

Versioning

Clone this wiki locally