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

前端 未结 2 2033
无人及你
无人及你 2021-02-07 23:55

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

Thanks!

2条回答
  •  庸人自扰
    2021-02-08 00:27

    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();
    

提交回复
热议问题