1. zain
  2. south

Commits

zain  committed f52fe49

Fixing South ticket #469. LIKE A BOSS

  • Participants
  • Parent commits 37ee23a
  • Branches default

Comments (0)

Files changed (1)

File south/migration/migrators.py

View file
  • Ignore whitespace
 
 class LoadInitialDataMigrator(MigratorWrapper):
     
-    def load_initial_data(self, target):
+    def load_initial_data(self, target, db='default'):
         if target is None or target != target.migrations[-1]:
             return
         # Load initial data, if we ended up at target
         models.get_apps = new_get_apps
         loaddata.get_apps = new_get_apps
         try:
-            call_command('loaddata', 'initial_data', verbosity=self.verbosity)
+            call_command('loaddata', 'initial_data', verbosity=self.verbosity, database=db)
         finally:
             models.get_apps = old_get_apps
             loaddata.get_apps = old_get_apps
         migrator = self._migrator
         result = migrator.__class__.migrate_many(migrator, target, migrations, database)
         if result:
-            self.load_initial_data(target)
+            self.load_initial_data(target, db=database)
         return True