The Old Sewing Factory

The Old Sewing Factory

04 Mar 2010

Code Templates for MigratorDotNet

UPDATE: A newer version of this code is available here

I’ve been hacking around with database migrations and decided to give MigratorDotNet a go. The first problem I found was that I had to manually number the migrations. The trick of using the migration attribute with the current date and time formatted as yyyyMMddhhssfff works a charm, but is a pain to type more than once.

So to solve the problem I’ve created a code template that gives you something like this as a shell:

To install it you need to do a couple of things, take the dll from in here and register it in your GAC and then take this zip and drop it into \Visual Studio 2010\Templates\ItemTemplates\Visual C#. Restart Visual studio and you can now add a migration from the new item menu.

I’ve only tried this in visual studio 2010 and have done no real testing. License wise, let people know I wrote it. If it breaks your machine, steals your financial identity, runs off with your wife and then crashes your car into a wall, it’s your own fault for running code you found on the internet. You have been warned.

comments powered by Disqus