Пример #1
0
 public void Unapply(MigrationSpecification migration)
 {
     var tasks = new List<Task>();
     if (IsTestDatabase)
         RunSql(tasks, migration.DeleteTestData);
     RunSql(tasks, migration.Unapply);
     Task.WaitAll(tasks.ToArray());
 }
Пример #2
0
        public void Unapply(MigrationSpecification migration)
        {
            var tasks = new List <Task>();

            if (IsTestDatabase)
            {
                RunSql(tasks, migration.DeleteTestData);
            }
            RunSql(tasks, migration.Unapply);
            Task.WaitAll(tasks.ToArray());
        }
Пример #3
0
        public void Apply(MigrationSpecification migration)
        {
            var tasks = new List <Task>();

            RunSql(tasks, migration.Apply);
            if (IsTestDatabase)
            {
                RunSql(tasks, migration.InsertTestData);
            }
            Task.WaitAll(tasks.ToArray());
        }
Пример #4
0
 public Migration(Go direction, MigrationSpecification spec)
 {
     Direction = direction;
     Spec      = spec;
 }
Пример #5
0
 public abstract void Execute(IDatabase target, MigrationSpecification migration);
Пример #6
0
 public override void Execute(IDatabase target, MigrationSpecification migration)
 {
     target.Unapply(migration);
 }
Пример #7
0
        public void LoadingFileShouldFindUpgradeScript()
        {
            var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName));

            testSubject.Apply.Should().Be("create table Foo;");
        }
Пример #8
0
        public void LoadingFileShouldFindSectionToDeleteTestData()
        {
            var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName));

            testSubject.DeleteTestData.Should().Be("delete from Foo;");
        }
Пример #9
0
        public void LoadingFileShouldFindSectionToAddTestData()
        {
            var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName));

            testSubject.InsertTestData.Should().Be("insert into Foo;");
        }
Пример #10
0
        public void LoadingFileShouldFindMigrationVersionNumber()
        {
            var testSubject = new MigrationSpecification(new MigrationFile(new StringReader(TrivialMigration), ValidFileName));

            testSubject.Version.Should().Be(3345);
        }
Пример #11
0
 public Migration(Go direction, MigrationSpecification spec)
 {
     this.Direction = direction;
     this.Spec = spec;
 }
Пример #12
0
 public abstract void Execute(IDatabase target, MigrationSpecification migration);
Пример #13
0
 public override void Execute(IDatabase target, MigrationSpecification migration)
 {
     target.Unapply(migration);
 }
Пример #14
0
 public void Unapply(MigrationSpecification migration)
 {
     this.UnappliedMigrations.Add(migration);
 }
Пример #15
0
 public void Unapply(MigrationSpecification migration)
 {
     UnappliedMigrations.Add(migration);
 }