How do you tell if your migrations are up to date with migratordotnet?
Posted
by Lance Fisher
on Stack Overflow
See other posts from Stack Overflow
or by Lance Fisher
Published on 2009-05-21T17:31:36Z
Indexed on
2010/03/30
7:53 UTC
Read the original article
Hit count: 438
I'm using migratordotnet to manage my database migrations. I'm running them on application setup like this, but I would also like to check on application startup that the migrations are up to date, and provide the option to migrate to latest. How do I tell if there are available migrations that need to be applied? I see that I can get the migrations that were applied like this
var asm = Assembly.GetAssembly(typeof(Migration_0001));
var migrator = new Migrator.Migrator("SqlServer", setupInfo.DatabaseConnectionString, asm);
var applied = migrator.AppliedMigrations;
I like to do something like this:
var available = migrator.AvailableMigrations; //this property does not exist.
© Stack Overflow or respective owner