예제 #1
0
 private IMigrationProcessorFactory GetMigrationProcessorFactory(IDatabaseConfig databaseConfig)
 {
     string processorName;
     var vendor = databaseConfig.Vendor;
     if (!DatabaseProcessorMapping.TryGetValue(vendor.ToUpper(), out processorName))
     {
         throw new Exception(string.Format("The vendor '{0}' processor type has not been set up for Habanero Test Migrations.", vendor));
     }
     var migrationProcessorFactoryProvider = new MigrationProcessorFactoryProvider();
     return migrationProcessorFactoryProvider.GetFactory(processorName);
 }
예제 #2
0
        private static IMigrationProcessor BuildMigrationProcessor(string database, string connection, int timeout, IAnnouncer announcer, bool previewOnly)
        {
            var processorFactoryProvider = new MigrationProcessorFactoryProvider();
            var processorFactory = processorFactoryProvider.GetFactory(database);

            var processorOptions = new ProcessorOptions
            {
                Timeout = timeout,
                PreviewOnly = previewOnly
            };

            var processor = processorFactory.Create(connection, announcer, processorOptions);
            return processor;
        }