protected void SetUp(IMigrationProcessorFactory processorFactory) { this.factory = processorFactory; this.connectionString = "Data Source=localhost/XE;User Id=Something;Password=Something"; this.announcer = new NullAnnouncer(); this.options = new ProcessorOptions(); }
protected void SetUp(IMigrationProcessorFactory processorFactory) { this.factory = processorFactory; this.connectionString = "Data Source=localhost/XE;User Id=Something;Password=Something"; this.announcer = new NullAnnouncer(); this.options = new ProcessorOptions(); }
private MigrationRunner CreateRunner(MigrationDb db, out StringBuilder output) { var sb = output = new StringBuilder(); var announcer = new TextWriterAnnouncer(s => { if (sb.Length == 0) { sb.AppendLine(); } sb.Append(s); }); IMigrationProcessorFactory factory = CreateFactory(db.DatabaseServer); IMigrationProcessor processor = factory.Create(db.ConnectionString, announcer, new MigrationOptions(db)); var context = new RunnerContext(announcer) { Namespace = db.NamespaceContainingMigrations, ApplicationContext = _kernel }; return(new MigrationRunner(db.Assembly, context, processor)); }
private static MigrationRunner GetRunner(string connectionString, IMigrationProcessorFactory factory) { var announcer = new NullAnnouncer(); var assembly = Assembly.GetExecutingAssembly(); var migrationContext = new RunnerContext(announcer) { Namespace = "Migrations" }; var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 }; var processor = factory.Create(connectionString, announcer, options); return new MigrationRunner(assembly, migrationContext, processor); }
protected void SetUp(IMigrationProcessorFactory processorFactory) { if (!IntegrationTestOptions.Oracle.IsEnabled) { Assert.Ignore(); } this.factory = processorFactory; this.connectionString = "Data Source=localhost/XE;User Id=Something;Password=Something"; this.announcer = new NullAnnouncer(); this.options = new ProcessorOptions(); }
public static void Register(IMigrationProcessorFactory factory) { lock (_lock) { if (_migrationProcessorFactories == null) { _migrationProcessorFactories = new Dictionary <string, IMigrationProcessorFactory>(StringComparer.OrdinalIgnoreCase); } _migrationProcessorFactories[factory.Name] = factory; } }
private static MigrationRunner GetRunner(string connectionString, IMigrationProcessorFactory factory) { var announcer = new NullAnnouncer(); var assembly = Assembly.GetExecutingAssembly(); var migrationContext = new RunnerContext(announcer) { Namespace = "Migrations" }; var options = new MigrationOptions { PreviewOnly = false, Timeout = 60 }; var processor = factory.Create(connectionString, announcer, options); return(new MigrationRunner(assembly, migrationContext, processor)); }
public void Migrate() { IAnnouncer announcer = new ServiceStackLoggingAnnouncer(_logFactory) { ShowSql = true }; IMigrationProcessorFactory migrationProcessorFactory = GetMigrationProcessorFactory(_configuration["DB_TYPE"]); ProcessorOptions options = new ProcessorOptions { PreviewOnly = false, // set to true to see the SQL Timeout = 60 }; using (IMigrationProcessor processor = migrationProcessorFactory.Create(_configuration["CONNECTION_STRING"], announcer, options)) { MigrationRunner runner = new MigrationRunner(GetType().Assembly, new RunnerContext(announcer), processor); runner.MigrateUp(); } }
public void CanRetrieveOracleFactoryWithArgumentString() { IMigrationProcessorFactory factory = ProcessorFactory.GetFactory("Oracle"); Assert.IsTrue(factory.GetType() == typeof(OracleProcessorFactory)); }
public void CanRetrieveSqlServerCeFactoryWithArgumentString() { IMigrationProcessorFactory factory = ProcessorFactory.GetFactory("SqlServerCe"); Assert.IsTrue(factory.GetType() == typeof(SqlServerCeProcessorFactory)); }
public void RetrievesSqlServerProcessorFactoryIfArgumentIsSqlServer() { IMigrationProcessorFactory factory = ProcessorFactory.GetFactory("SqlServer"); Assert.IsTrue(factory.GetType() == typeof(SqlServerProcessorFactory)); }
public void CanRetrieveSqlServer2016FactoryWithArgumentString() { IMigrationProcessorFactory factory = _migrationProcessorFactoryProvider.GetFactory("SqlServer2016"); Assert.IsTrue(factory.GetType() == typeof(SqlServer2016ProcessorFactory)); }
public void CanRetrieveFactoryWithArgumentString() { IMigrationProcessorFactory factory = _migrationProcessorFactoryProvider.GetFactory("SQLite"); Assert.IsTrue(factory.GetType() == typeof(SQLiteProcessorFactory)); }
public void CanRetrieveOracleManagedFactoryWithArgumentString() { IMigrationProcessorFactory factory = _migrationProcessorFactoryProvider.GetFactory("OracleManaged"); Assert.IsTrue(factory.GetType() == typeof(OracleManagedProcessorFactory)); }