Ticket #25855: 0001-Fixed-25855-Added-more-accurate-info-to-migration.diff

File 0001-Fixed-25855-Added-more-accurate-info-to-migration.diff, 1.2 KB (added by Emre Yılmaz, 9 years ago)

Patch for ticket #25855

  • django/core/management/commands/runserver.py

    diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
    index 6d05fa8..e368751 100644
    a b class Command(BaseCommand):  
    172172
    173173        plan = executor.migration_plan(executor.loader.graph.leaf_nodes())
    174174        if plan:
    175             self.stdout.write(self.style.NOTICE(
    176                 "\nYou have unapplied migrations; your app may not work properly until they are applied."
    177             ))
     175            apps_waiting_migration = sorted(set(migration.app_label for migration, backwards in plan))
     176            self.stdout.write(
     177                self.style.NOTICE(
     178                    "\nYou have %(unpplied_migration_count)s unapplied migrations; your project may not work properly "
     179                    "until apps [%(apps_waiting_migration)s] have their migrations applied." % {
     180                        "unpplied_migration_count": len(plan),
     181                        "apps_waiting_migration": ", ".join(apps_waiting_migration)
     182                    }
     183                )
     184            )
    178185            self.stdout.write(self.style.NOTICE("Run 'python manage.py migrate' to apply them.\n"))
    179186
Back to Top