diff options
| author | Jim Nicholls <jim.nicholls@sydney.edu.au> | 2016-08-13 19:33:58 +1000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-08-18 08:45:41 -0400 |
| commit | 16f032e69fb9c06fd0d9feda35bba12195651214 (patch) | |
| tree | bc3ede3aa8de5d27677c72af581afcb225402ce6 /django | |
| parent | c24a47b3e6cfba88ee7792be25da5b5333266abe (diff) | |
[1.10.x] Fixed #27054 -- Fixed makemigrations crash with a read-only database.
Backport of 76ab8851181675a59425f9637bdbf3f2de95f6f1 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/loader.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index d459f2c524..e5a7f031f9 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -6,6 +6,7 @@ from importlib import import_module from django.apps import apps from django.conf import settings +from django.db.migrations.exceptions import MigrationSchemaMissing from django.db.migrations.graph import MigrationGraph from django.db.migrations.recorder import MigrationRecorder from django.utils import six @@ -273,7 +274,12 @@ class MigrationLoader(object): unapplied dependencies. """ recorder = MigrationRecorder(connection) - applied = recorder.applied_migrations() + try: + applied = recorder.applied_migrations() + except MigrationSchemaMissing: + # Skip check if the django_migrations table is missing and can't be + # created. + return for migration in applied: # If the migration is unknown, skip it. if migration not in self.graph.nodes: |
