Esempio n. 1
0
 //[Fact]
 public void automatic_a_test()
 {
     DatabaseMigration.ConfigureFor(_db)
     .WithLogger(new ConsoleLogger())
     //.WithResolver(ActivatorContainer.Instance)
     .SearchAssemblyOf <AutomaticMigrationTests>()
     .PerformAutomaticMigrations();
 }
Esempio n. 2
0
 IManageMigrations BuildManager()
 {
     return(DatabaseMigration.ConfigureFor(_db)
            .SearchAssembly(Assembly.GetExecutingAssembly())
            .WithLogger(new ConsoleLogger())
            .WithResolver(ActivatorContainer.Instance)
            .Build());
 }
Esempio n. 3
0
 public void missing_migrations_throws()
 {
     Assert.Throws <MigrationNotFoundException>(
         () => DatabaseMigration.ConfigureFor(_db)
         .SearchAssembly(Assembly.GetCallingAssembly())
         .WithLogger(new ConsoleLogger())
         .WithResolver(ActivatorContainer.Instance)
         .Build());
 }
 public static void RunMigrations(string connectionString)
 {
     using (var db = new SqlFuConnection(connectionString))
     {
         DatabaseMigration <SqlFuConnection>
         .ConfigureFor(db)
         .SearchAssemblyOf <SqlFuMigration1>()
         .WithAutomaticMigrationRepository(new SqlFuAutomaticMigrationRepo(db))
         .WithUnitOfWorkCreator(new DatabaseTransactionManager())
         .PerformAutomaticMigrations();
     }
 }
        public static void RunMigrations(string connectionString)
        {
            var connection = new AzureSearchConnection();

            connection.ConnectionString = ConfigurationManager.ConnectionStrings[connectionString].ConnectionString;

            using (var db = ApiConnection.Create(connection.Service, connection.Key))
            {
                DatabaseMigration <ApiConnection>
                .ConfigureFor(db)
                .SearchAssemblyOf <SqlFuMigration1>()
                .WithAutomaticMigrationRepository(new AzureSearchAutomaticMigrationRepo(db))
                .PerformAutomaticMigrations();
            }
        }