Commits

mbek committed 0e17add

Apply dry_run on DryMigration for all databases in south.db.dbs, not just default one

  • Participants
  • Parent commits 050efbb

Comments (0)

Files changed (1)

south/migration/migrators.py

     def print_title(self, target):
         if self.verbosity:
             print(self.title(target))
-        
+
     @staticmethod
     def status(target):
         raise NotImplementedError()
             except:
                 print("Error during commit in migration: %s" % migration)
                 raise
-                
+
 
     def run(self, migration, database):
         # Get the correct ORM.
             if self.verbosity:
                 print(" - Migration '%s' is marked for no-dry-run." % migration)
             return
-        south.db.db.dry_run = True
+        for name, db in south.db.dbs.iteritems():
+            south.db.dbs[name].dry_run = True
         # preserve the constraint cache as it can be mutated by the dry run
         constraint_cache = deepcopy(south.db.db._constraint_cache)
         if self._ignore_fail:
             if self._ignore_fail:
                 south.db.db.debug = old_debug
             south.db.db.clear_run_data(pending_creates)
-            south.db.db.dry_run = False
+            for name, db in south.db.dbs.iteritems():
+                south.db.dbs[name].dry_run = False
             # restore the preserved constraint cache from before dry run was
             # executed
             south.db.db._constraint_cache = constraint_cache