From ddcf7dbae7f6e5fd3c3398aba13bf55b95c80a62 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 1 Aug 2016 07:57:12 -0400 Subject: [1.10.x] Fixed #26930 -- Prevented makemigrations from accessing an empty database. Thanks Liz Lemon for the report and investigation and Claude Paroz for the test. Backport of aad46c3e370e105f9117a337924090d05f1b001d from master --- django/core/management/commands/makemigrations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'django') diff --git a/django/core/management/commands/makemigrations.py b/django/core/management/commands/makemigrations.py index b8c05486fc..f9f50cc2ad 100644 --- a/django/core/management/commands/makemigrations.py +++ b/django/core/management/commands/makemigrations.py @@ -95,7 +95,9 @@ class Command(BaseCommand): # Raise an error if any migrations are applied before their dependencies. for db in connections: - loader.check_consistent_history(connections[db]) + connection = connections[db] + if connection.settings_dict['ENGINE'] != 'django.db.backends.dummy': + loader.check_consistent_history(connection) # Before anything else, see if there's conflicting apps and drop out # hard if there are any and they don't want to merge -- cgit v1.3