RikMigrations - Types

RikMigrations currently supports the following types. Adding new types is often simple so drop a comment on CodePlex if you need something which is missing. Many of these types are not available in the 0.1 release so you will need to download the current source code drop from CodePlex.

If you wish to use a database type which is not in this list you can use the "SqlType" property on a column to supply a custom type. This will override any other type setting for the column. 

SQL Server Type -> C# Type/VB Type

int -> int/Integer
tinyint -> byte/Byte
smallint -> short/Short
bigint -> long/Long
float -> double/Double
real -> float/Single
bit -> bool/Boolean
uniqueidentifier -> System.Guid
datetime -> System.DateTime
nvarchar,varchar -> string/String
nvarchar(max),varchar(max) -> string/String
ntext,text -> string/String
nchar,char -> char/Char
decimal -> decimal/Decimal
varbinary,image -> byte[]/Byte()

text, ntext and image fields are created by calling the "Blob" method.

By default strings are unicode (ntext, nvarchar, nchar). Use the "NonUnicode()" method to change this.

To specify varchar(max), nvarchar(max) and varbinary(max) simply specify a length long enough (greater than 8000 for varchar and varbinary, greater than 4000 for nvarchar, but I suggest using int.MaxValue to make it clear what your intention is.

Back to RikMigrations Homepage

About Us

RikWare is a software development company based in Brisbane, Australia. Led by director, Richard Mason, RikWare focusses on solving challenging business problems promptly and effectively.

RikWare is also the owner of Aussie Bushwalking, a free, wiki-like collaboration site for bushwalkers and the creator of RikMigrations, a migration framework for .NET.

Aussie Bushwalking

Want to discover some new bushwalking ideas? Share a few of your own? Aussie Bushwalking is like Wikipedia... but for bushwalkers. Head on over. Anybody can see the walks and it's free to sign up and share your own.



RikMigrations is a database migration library for .NET based on the migrations facility provided by Ruby on Rails. It allows simple upgrading and downgrading of databases using .NET code (such as VB or C#) either from the command line or built into your application. Unlike many other migration frameworks, RikMigrations is a stand-alone library which does not rely on a large surrounding framework.