Commits

Daniel Gonçalves  committed 97e9af8 Draft

Avoid record ran migrations in dry-run mode.
Method south.migration.Migrator.done_migrate wiped out.

  • Participants
  • Parent commits fbdbce6

Comments (0)

Files changed (1)

File south/migration/migrators.py

         try:
             migration_function()
             south.db.db.execute_deferred_sql()
-            # record us as having done this in the same transaction
-            self.record(migration, database)
+            if not isinstance(getattr(self, '_wrapper', self), DryRunMigrator):
+                # record us as having done this in the same transaction,
+                # since we're not in a dry run
+                self.record(migration, database)
         except:
             south.db.db.rollback_transaction()
             if not south.db.db.has_ddl_transactions:
             if not south.db.db.has_ddl_transactions:
                 dry_run = DryRunMigrator(migrator=self, ignore_fail=False)
                 dry_run.run_migration(migration, database)
-        return self.run_migration(migration)
+        return self.run_migration(migration, database)
 
-    def done_migrate(self, migration, database):
-        south.db.db.start_transaction()
-        try:
-            # Record us as having done this
-            self.record(migration, database)
-        except:
-            south.db.db.rollback_transaction()
-            raise
-        else:
-            south.db.db.commit_transaction()
 
     def send_ran_migration(self, migration):
         ran_migration.send(None,
                 return False
             raise
 
-    def done_migrate(self, *args, **kwargs):
-        pass
-
     def send_ran_migration(self, *args, **kwargs):
         pass