#22485: makemigrations fails with dependencies to unmigrated apps
-------------------------------------+-------------------------------------
     Reporter:  apollo13             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Migrations           |                  Version:  master
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  migrations,          |             Triage Stage:  Accepted
  unmigrated, makemigrations         |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by Anton Agestam <msn@…>):

 I'm still seeing this in 1.7b4.

 Traceback:


 {{{
 (mcr-api)~/.virtualenvs/mcr-api ☕  m migrate clothing 0001
 Operations to perform:
   Target specific migration: 0001_initial, from clothing
 Running migrations:
   Applying clothing.0001_initial...Traceback (most recent call last):
   File "manage.py", line 10, in <module>
     execute_from_command_line(sys.argv)
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/core/management/__init__.py", line 427, in
 execute_from_command_line
     utility.execute()
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/core/management/__init__.py", line 419, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/core/management/base.py", line 288, in run_from_argv
     self.execute(*args, **options.__dict__)
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/core/management/base.py", line 337, in execute
     output = self.handle(*args, **options)
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/core/management/commands/migrate.py", line 146, in
 handle
     executor.migrate(targets, plan, fake=options.get("fake", False))
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/db/migrations/executor.py", line 62, in migrate
     self.apply_migration(migration, fake=fake)
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/db/migrations/executor.py", line 90, in
 apply_migration
     if self.detect_soft_applied(migration):
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/db/migrations/executor.py", line 134, in
 detect_soft_applied
     apps = project_state.render()
   File "/Users/antonagestam/.virtualenvs/mcr-
 api/src/django/django/db/migrations/state.py", line 86, in render
     model=lookup_model,
 ValueError: Lookup failed for model referenced by field
 admin.LogEntry.user: user.User
 (mcr-api)~/.virtualenvs/mcr-api ☕  python -c "import django; print
 django.get_version()"
 1.7b4
 }}}

 Here's the migration:

 {{{
 # encoding: utf8
 from __future__ import unicode_literals

 from django.db import models, migrations


 class Migration(migrations.Migration):

     dependencies = [
     ]

     operations = [
         migrations.CreateModel(
             name=b'ClothingStart',
             fields=[
                 (b'id', models.AutoField(serialize=False,
 primary_key=True)),
                 (b'clothing_id', models.IntegerField()),
                 (b'created_at', models.DateTimeField()),
                 (b'updated_at', models.DateTimeField()),
             ],
             options={
                 'db_table': b'clothing_start',
             },
             bases=(models.Model,),
         ),
         migrations.CreateModel(
             name=b'ClothingWebshop',
             fields=[
                 (b'id', models.AutoField(serialize=False,
 primary_key=True)),
                 (b'clothing_id', models.IntegerField()),
                 (b'brand_id', models.IntegerField()),
                 (b'url', models.CharField(max_length=255)),
                 (b'created_at', models.DateTimeField()),
                 (b'updated_at', models.DateTimeField()),
                 (b'star_id', models.IntegerField()),
             ],
             options={
                 'db_table': b'clothing_webshop',
             },
             bases=(models.Model,),
         ),
     ]
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22485#comment:37>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.c167350beb6d3bbc4bea73b37832e17f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to