| 1 | (dev3)knbk@dev-vm:~/projects/django18-migration-bug$ manage migrate
|
|---|
| 2 | Operations to perform:
|
|---|
| 3 | Synchronize unmigrated apps: messages, staticfiles
|
|---|
| 4 | Apply all migrations: auth, contenttypes, debug, admin, sessions
|
|---|
| 5 | Synchronizing apps without migrations:
|
|---|
| 6 | Creating tables...
|
|---|
| 7 | Running deferred SQL...
|
|---|
| 8 | Installing custom SQL...
|
|---|
| 9 | Running migrations:
|
|---|
| 10 | No migrations to apply.
|
|---|
| 11 | Traceback (most recent call last):
|
|---|
| 12 | File "/home/knbk/projects/dev/django/django/apps/config.py", line 159, in get_model
|
|---|
| 13 | return self.models[model_name.lower()]
|
|---|
| 14 | KeyError: 'spam'
|
|---|
| 15 |
|
|---|
| 16 | During handling of the above exception, another exception occurred:
|
|---|
| 17 |
|
|---|
| 18 | Traceback (most recent call last):
|
|---|
| 19 | File "/home/knbk/projects/dev/django/django/db/migrations/state.py", line 226, in __init__
|
|---|
| 20 | model = self.get_model(lookup_model[0], lookup_model[1])
|
|---|
| 21 | File "/home/knbk/projects/dev/django/django/apps/registry.py", line 202, in get_model
|
|---|
| 22 | return self.get_app_config(app_label).get_model(model_name.lower())
|
|---|
| 23 | File "/home/knbk/projects/dev/django/django/apps/config.py", line 162, in get_model
|
|---|
| 24 | "App '%s' doesn't have a '%s' model." % (self.label, model_name))
|
|---|
| 25 | LookupError: App 'debug' doesn't have a 'spam' model.
|
|---|
| 26 |
|
|---|
| 27 | During handling of the above exception, another exception occurred:
|
|---|
| 28 |
|
|---|
| 29 | Traceback (most recent call last):
|
|---|
| 30 | File "manage.py", line 10, in <module>
|
|---|
| 31 | execute_from_command_line(sys.argv)
|
|---|
| 32 | File "/home/knbk/projects/dev/django/django/core/management/__init__.py", line 338, in execute_from_command_line
|
|---|
| 33 | utility.execute()
|
|---|
| 34 | File "/home/knbk/projects/dev/django/django/core/management/__init__.py", line 330, in execute
|
|---|
| 35 | self.fetch_command(subcommand).run_from_argv(self.argv)
|
|---|
| 36 | File "/home/knbk/projects/dev/django/django/core/management/base.py", line 390, in run_from_argv
|
|---|
| 37 | self.execute(*args, **cmd_options)
|
|---|
| 38 | File "/home/knbk/projects/dev/django/django/core/management/base.py", line 441, in execute
|
|---|
| 39 | output = self.handle(*args, **options)
|
|---|
| 40 | File "/home/knbk/projects/dev/django/django/core/management/commands/migrate.py", line 207, in handle
|
|---|
| 41 | changes = autodetector.changes(graph=executor.loader.graph)
|
|---|
| 42 | File "/home/knbk/projects/dev/django/django/db/migrations/autodetector.py", line 43, in changes
|
|---|
| 43 | changes = self._detect_changes(convert_apps, graph)
|
|---|
| 44 | File "/home/knbk/projects/dev/django/django/db/migrations/autodetector.py", line 110, in _detect_changes
|
|---|
| 45 | self.old_apps = self.from_state.concrete_apps
|
|---|
| 46 | File "/home/knbk/projects/dev/django/django/db/migrations/state.py", line 158, in concrete_apps
|
|---|
| 47 | self.apps = StateApps(self.real_apps, self.models, ignore_swappable=True)
|
|---|
| 48 | File "/home/knbk/projects/dev/django/django/db/migrations/state.py", line 236, in __init__
|
|---|
| 49 | raise ValueError(msg.format(field=operations[0][1], model=lookup_model))
|
|---|
| 50 | ValueError: Lookup failed for model referenced by field debug.John.consumed_food: debug.Spam
|
|---|