0

We're starting to use Migrator.NET for managing our database migrations, its fantastic but we have an additional requirement that plug-ins written for our software which require their own custom fields added (depending on the plug in of course).

So basically we have a our core database tables, and our plugin specific tables.

I was hoping that in Migrator.NET I would see some sort of additional attribute like this

[Migration(1, "Core")
public class Migration1 : Migration
{
}

so that I'd be able to then plug in developers would then be able to do something like

[Migration(1, "PluginName")
public class Migration1 : Migration
{
}

Unfortunately this parameter doesn't exist, and the version table doesn't seem to have any place to store a tag/plugin name

CREATE TABLE [dbo].[VersionInfo](
    [Version] [bigint] NOT NULL,
    [AppliedOn] [datetime] NULL
) ON [PRIMARY]

Does anybody have any ideas how I would go about doing this?

I've seen that Ruby/Redmine support this sort of architecture as they allow plugins to include their own db migrations, however would love to be able to do this in MigratorDotNet.

David Chiew
  • 584
  • 5
  • 13
  • Ok I've discovered RikMigrations has support for a "Module" [assembly: Migration(typeof(M001_Update), 1, "ModuleName"] only problem is it doesn't support MySql! and the project seems pretty st ale compared to FluentMigrations. Anyway with a module name plugin developers can simply specify their plug in name as a module so I'm almost there. Anyone have a solution for MySql? – David Chiew Jul 22 '13 at 23:43

1 Answers1

1

You mentioned you're tagging, and you can filter migrations based on Tags, like so:

[Tags("DK", "NL", "UK")]
[Tags("Staging", "Production")]
[Migration(1)]
public class DoSomeStuffToEuropeanStagingAndProdDbs() { }

See the following wiki page for more details:

https://github.com/schambers/fluentmigrator/wiki/Filter-migrations-run-based-on-Tags

Castrohenge
  • 8,525
  • 5
  • 39
  • 66