Maintaining Migrator.NET

It seems we have lost Marc to the fabled land of Ruby. Well I still need Migrator for my current projects, and I need my patched version of the trunk too. Patching is a PITA in the subversion world, especially if you create new directories. So for the moment I am maintaining Migrator, until I also make the move, or somesuch.

I have a branch with the fixes I have from my local repository (the pain of patching caused me to propose this to Marc):

http://code.macournoyer.com/svn/migrator/branches/refactoring

This will be a drop-in replacement for the current trunk. But I have not ported the code for Postgres or SqlServer. Postgres will probably come soon. SqLite if I have time.

Features in the branch:

Major:

Refactorings to make it easier to maintain the different DB providers. Namely each provider implements an interface, that maps to the different types, so adding new types should be easier (i.e. break the build until the interface is satisfied).

New ColumnOptions enumerations. For Indexing, Unsigned, Foreign Keys, etc.

ForeignKeyConstraint enumeration for the expected action when enforcing constraints on foreign keys. This has only been implement on mysql, so the options may not make sense for other DBs. Not sure.

Some Foreign Key generation methods, that generate the FK_name automatically. This will be worked on a bit more, as taking down the FK currently requires you to guess the FK name still.

The Migration class accepts the args from MigratorConsole. I needed this in my project, related to the next change.

The Migration class also has a virtual InitialiseOnce method, that can be overridden in a base class of your migrations, so that things like setting up Castle.ActiveRecord can be performed (Setting up ActiveRecord needs to be done in the currently running assembly to work sanely). This is used for setting up inital data (i.e. groups etc.), in a DB agnostic way. Just like the migrations do.

OK, so its quite a few changes, but patching is PITA, & I left it for too long.

Please checkout, see if your code still works. I’d be interested to know how many others use Migration.NET

Oh, and if anyone want to contact me (whups!) code+nick.hems at g-to-the-mail.com. (thats gmail guys).

5 Responses to “Maintaining Migrator.NET”

  1. The Migrations for .NET project is not dead yet! « Marc-AndrĂ© Cournoyer’s blog Says:

    [...] keep getting patches and questions for the Migrator. And hopefully for my fellow .NET readers, Nick Hemsley will be the future maintainer of that project. And by the refactorings he’ve already done in [...]

  2. dru Says:

    AWESOME! Keep up the good work!
    -d

  3. Darius Damalakas Says:

    Yes! That’s a very good news.

    We will soon need Firebird db support (hopefully this or next month), so expect a patch one day.
    :)

  4. Josh Robb Says:

    Thats great news. I’ve had to fork my own version of the SqlServerTransformationProvider to solve some problems I’ve been having.

  5. Paul Kohler Says:

    Phew! I was a bit worried that it was dead - thanks for taking up the task. Do you use the (boo) generator scripts too?

Leave a Reply