Created
February 1, 2011 05:08
-
-
Save dcrosby42/805447 to your computer and use it in GitHub Desktop.
Utility code that uses MigratorDotNet to execute full sweep migrations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace UnitTests.TestHelpers | |
{ | |
public class MigrationTestHelper | |
{ | |
public static readonly string Provider = "SqlServer"; | |
public static readonly string ConnectString = "Database=myapp_test;Data Source=localhost;User Id=myUser;Password=abc123"; | |
public static Migrator.Migrator GetMigrator() | |
{ | |
var assembly = Assembly.GetAssembly(typeof(BootstrapAspDotNetAuthTables)); | |
return new Migrator.Migrator(Provider, ConnectString, assembly); | |
} | |
public static void MigrateAllTheWayUp() | |
{ | |
GetMigrator().MigrateToLastVersion(); | |
} | |
public static void MigrateAllTheWayDown() | |
{ | |
GetMigrator().MigrateTo(0); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment