Skip to content

Instantly share code, notes, and snippets.

@dcrosby42
Created February 1, 2011 05:16
Show Gist options
  • Save dcrosby42/805453 to your computer and use it in GitHub Desktop.
Save dcrosby42/805453 to your computer and use it in GitHub Desktop.
Example snippet of Application_Start to execute migrations at startup
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
var assembly = Assembly.GetAssembly(typeof(MvcApplication));
var connectString = ConfigurationManager.ConnectStrings(“ApplicationServices”).ConnectionString;
var migrator = new Migrator(“SqlServer”, connectString, assembly);
migrator.MigrateToLastVersion();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment