#25698: App without migrations depending on app with migrations fails on initial
migrate call (postgres)
-------------------------------+------------------------------
     Reporter:  lucasmoeskops  |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.8
     Severity:  Normal         |   Keywords:  migrate postgres
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  1              |      UI/UX:  0
-------------------------------+------------------------------
 Simple test example:
 In a new project add 'django.contrib.sites' and your main app to the
 `INSTALLED APPS` setting.
 Use postgres as database.
 Make a model in your main app that uses a relation to
 django.contrib.sites:


 {{{
 from django.contrib.sites.models import Site
 class MyModel(models.Model):
   my_site = models.ForeignKey(Site)

 }}}

 Migrate the project:


 {{{
 python manage.py migrate
 }}}


 It will fail to migrate with the message:
 `django.db.utils.ProgrammingError: relation "django_site" does not exist`.
 This is because it tries to migrate the apps without migrations before the
 apps with migrations.

 I guess the app should have at least one migration with a dependency to
 django.contrib.sites. But maybe this needs to be documented. I couldn't
 find it in the documentation.

--
Ticket URL: <https://code.djangoproject.com/ticket/25698>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.f07769c5dea43e5e9c7a271699747123%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to