Search code examples
c#.net.net-3.5.net-2.0migrator.net

migratordotnet - Run migrations from within application (w/o nant or build)


is there a way to run migrations from within the application itself?

Thanks!


Solution

  • I instantiate an instance of the Migrator class, and then you can call member methods like MigrateToLastVersion() or MigrateTo(long versionnr)

    Migrator.Migrator m = new Migrator.Migrator ("SqlServer", connectionString, migrationsAssembly)
    
    m.MigrateToLastVersion();