add this method to your context:
/// <summary>migrates actual Database to given Migration Version
/// </summary>
/// <param name="toMigration">"0" ... Version 0 (remove all), "" is newest Version</param>
public void Migrate(string toMigration)
{
var configuration = new Configuration
{
TargetDatabase = new DbConnectionInfo(Database.Connection.ConnectionString, "System.Data.SqlClient")
};
var migrator = new DbMigrator(configuration);
migrator.Update(toMigration);
}
No comments:
Post a Comment