Search code examples
c#.netmigrationdata-migrationfluent-migrator

Execute FluentMigrator migrations from code


Are there any tutorials or example code for executing FluentMigrator migrations from within code? Some "Getting Started..." tutorial would be just awesome. All I was able to find was FluentMigrator.Tests (unit tests), inside FluentMigrator source, which are not as helpful as "Getting Started..." would be.

I just want to add few classes to the project and run the migrations from that project, with no external tools. Is it possible in Fluent Migrator? Something like

FluentMigrator.Migrate("database path", typeof(Migration024));

which I would call from Program.Main()?


Solution

  • Since fluent migrator is a fork of Migrator .NET you might find the getting started for Migrator .net helpful