Exemplo n.º 1
0
 private void RemoveMigration(IMigration migration, MigrationAttribute attr)
 {
     // we're removing this one
     _logger.MigrateDown(Current, migration.Name);
     if (! DryRun)
     {
         migration.Down();
         _provider.MigrationUnApplied(attr);
         _provider.Commit();
         migration.AfterDown();
     }
 }
Exemplo n.º 2
0
 private void ApplyMigration(IMigration migration, MigrationAttribute attr)
 {
     // we're adding this one
     _logger.MigrateUp(Current, migration.Name);
     if (! DryRun)
     {
         migration.Up();
         _provider.MigrationApplied(attr.Version);
         _provider.Commit();
         migration.AfterUp();
     }
 }
Exemplo n.º 3
0
		void ApplyMigration(IMigration migration, MigrationAttribute attr)
		{
			// we're adding this one
			_logger.MigrateUp(Current, migration.Name);
			if (! DryRun)
			{
                var tProvider = _provider as TransformationProvider;
			    if (tProvider != null) 
                    tProvider.CurrentMigration = migration;

				migration.Up();
                _provider.MigrationApplied(attr.Version, attr.Scope);
				_provider.Commit();
				migration.AfterUp();
			}
		}
 public void MigrationUnApplied(MigrationAttribute attribute)
 {
 	//no op
 }
Exemplo n.º 5
0
 private void ApplyMigration(IMigration migration, MigrationAttribute attr)
 {
     // we're adding this one
     _logger.MigrateUp(Current, migration.Name);
     if(! DryRun)
     {
         migration.Up();
         var v = attr.GetVersion(migration.GetType());
         _provider.MigrationApplied(v.Value, v.Key);
         _provider.Commit();
         migration.AfterUp();
     }
 }
Exemplo n.º 6
0
 private void RemoveMigration(IMigration migration, MigrationAttribute attr)
 {
     // we're removing this one
     _logger.MigrateDown(Current, migration.Name);
     if (! DryRun)
     {
         migration.Down();
         var v = attr.GetVersion(migration.GetType());
         _provider.MigrationUnApplied(v.Value, v.Key);
         _provider.Commit();
         migration.AfterDown();
     }
 }
    public void AppliedMigrations()
    {
        var mockMigration = new MigrationAttribute(1);

      Assert.IsFalse(_provider.TableExists("SchemaInfo"));

      // Check that a "get" call works on the first run.
      Assert.AreEqual(0, _provider.AppliedMigrations.Count);
      Assert.IsTrue(_provider.TableExists("SchemaInfo"), "No SchemaInfo table created");

      // Check that a "set" called after the first run works.
      _provider.MigrationApplied(mockMigration);
      Assert.AreEqual(1, _provider.AppliedMigrations[0]);

      _provider.RemoveTable("SchemaInfo");
      // Check that a "set" call works on the first run.
      _provider.MigrationApplied(mockMigration);
      Assert.AreEqual(1, _provider.AppliedMigrations[0]);
      Assert.IsTrue(_provider.TableExists("SchemaInfo"), "No SchemaInfo table created");
    }
 /// <summary>
 /// Marks a Migration attribute as having been rolled back from the database
 /// </summary>
 /// <param name="attribute">The migration attribute that was removed</param>
 public override void MigrationUnApplied(MigrationAttribute attribute)
 {
     CreateSchemaInfoTable();
     Delete(SchemaInfoTableName, "version", attribute.Version.ToString());
     _appliedMigrations.Remove(attribute.Version);
 }
 /// <summary>
 /// Marks a Migration attribute as having been applied
 /// </summary>
 /// <param name="attribute">The migration attribute that was applied</param>
 public override void MigrationApplied(MigrationAttribute attribute)
 {
     CreateSchemaInfoTable();
     Insert(SchemaInfoTableName, new[] { "version" }, new[] { attribute.Version.ToString() });
     _appliedMigrations.Add(attribute.Version);
 }
Exemplo n.º 10
0
			_appliedMigrations.Add(attribute.Version);
		}

	    /// <summary>
	    /// Marks a Migration attribute as having been rolled back from the database
	    /// </summary>
	    /// <param name="attribute">The migration attribute that was removed</param>
	    public virtual void MigrationUnApplied(MigrationAttribute attribute)
		{
            CreateSchemaInfoTable();
Exemplo n.º 11
0
			}
		}

	    /// <summary>
	    /// Marks a Migration attribute as having been applied
	    /// </summary>
	    /// <param name="attribute">The migration attribute that was applied</param>
	    public virtual void MigrationApplied(MigrationAttribute attribute)
		{
			CreateSchemaInfoTable();