RikWare
...

RikMigrations - Starting from an existing database

Thursday, 20 December 2007 11:44 by Richard Mason

RikMigrations includes support for generating an initial migration from an existing database. Currently this only supports SQL Server databases. The feature was included in the initial release, but hadn't had much testing. Since then I've tested it on a database at work and confirmed it's working correctly (at least to some extent). The migration generator attempts to ensure tables are created in the correct order, but this feature was hacked in and needs improving. In doesn't support circular dependencies so don't even try.

The generator only supports generating in C# at the moment, however it uses CodeDom so other support for other languages is simple to add and a quick hack of the code will provide a version for your favourite language. 

To generate a migration from a database use the following command line:

RikMigrations auto -s:(local) -db:Test -f:Migration.cs 

You can also add the "-sf" flag to write each table into a separate class, but make sure you include a "{0}" in the filename to indicate where to place the name of the table.

kick it on DotNetKicks.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Comments

December 20. 2007 11:54

trackback

Trackback from DotNetKicks.com

RikMigrations - Starting from an existing database

DotNetKicks.com

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

November 21. 2008 22:54