public void Unapply(MigrationSpecification migration) { var tasks = new List<Task>(); if (IsTestDatabase) RunSql(tasks, migration.DeleteTestData); RunSql(tasks, migration.Unapply); Task.WaitAll(tasks.ToArray()); }
public void Unapply(MigrationSpecification migration) { var tasks = new List <Task>(); if (IsTestDatabase) { RunSql(tasks, migration.DeleteTestData); } RunSql(tasks, migration.Unapply); Task.WaitAll(tasks.ToArray()); }
public void Apply(MigrationSpecification migration) { var tasks = new List <Task>(); RunSql(tasks, migration.Apply); if (IsTestDatabase) { RunSql(tasks, migration.InsertTestData); } Task.WaitAll(tasks.ToArray()); }
public Migration(Go direction, MigrationSpecification spec) { Direction = direction; Spec = spec; }
public abstract void Execute(IDatabase target, MigrationSpecification migration);
public override void Execute(IDatabase target, MigrationSpecification migration) { target.Unapply(migration); }
public void LoadingFileShouldFindUpgradeScript() { var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName)); testSubject.Apply.Should().Be("create table Foo;"); }
public void LoadingFileShouldFindSectionToDeleteTestData() { var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName)); testSubject.DeleteTestData.Should().Be("delete from Foo;"); }
public void LoadingFileShouldFindSectionToAddTestData() { var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName)); testSubject.InsertTestData.Should().Be("insert into Foo;"); }
public void LoadingFileShouldFindMigrationVersionNumber() { var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName)); testSubject.Version.Should().Be(3345); }
public Migration(Go direction, MigrationSpecification spec) { this.Direction = direction; this.Spec = spec; }
public void Unapply(MigrationSpecification migration) { this.UnappliedMigrations.Add(migration); }
public void Unapply(MigrationSpecification migration) { UnappliedMigrations.Add(migration); }