[Django] #24588: Improve handling apps without migrations while running migrate command.

6 views
Skip to first unread message

Django

unread,
Apr 6, 2015, 10:15:43 AM4/6/15
to django-...@googlegroups.com
#24588: Improve handling apps without migrations while running migrate command.
-----------------------------+----------------------
Reporter: coldmind | Owner: coldmind
Type: New feature | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+----------------------
Consider situation - https://pypi.python.org/pypi/django-contrib-
comments/1.5 does not have a migration inside.
It depends on Content-Type model.
So we get something like:
{{{
claudep: the traceback shows that the exception happens when syncing apps
without migrations
[4:23pm] knbk: that "worked" with a big disclaimer on 1.7 but was
unsupported, but somehow breaks on 1.8
[4:23pm] claudep: so the issue is "a unmigrated app depends on an app with
migrations"
}}}

The error is `django.db.utils.ProgrammingError: relation
"django_content_type" does not exist`.
Steps to reproduce - simply add `django_comments` to clean project and run
`python manage.py migrate`. (But, I can reproduce with on postgres, but
not on sqlite for example).

We need to improve handling apps, that does not have a migration, and show
more user-friendly error rather than throwing exception, which user must
investigate.

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

Django

unread,
Apr 6, 2015, 10:18:25 AM4/6/15
to django-...@googlegroups.com
#24588: Improve handling apps without migrations while running migrate command.
--------------------------------------+------------------------------------
Reporter: coldmind | Owner: coldmind
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* type: New feature => Cleanup/optimization
* needs_tests: => 0
* needs_docs: => 0


Comment:

Raising a meaningful error telling which app failed (maybe which SQL
statement?) would be welcome.

--
Ticket URL: <https://code.djangoproject.com/ticket/24588#comment:1>

Django

unread,
Apr 6, 2015, 10:20:46 AM4/6/15
to django-...@googlegroups.com
#24588: Improve handling apps without migrations while running migrate command.
--------------------------------------+------------------------------------
Reporter: coldmind | Owner: coldmind
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by coldmind):

I will work in patch

--
Ticket URL: <https://code.djangoproject.com/ticket/24588#comment:2>

Django

unread,
Apr 8, 2015, 2:24:34 PM4/8/15
to django-...@googlegroups.com
#24588: Improve handling apps without migrations while running migrate command.
--------------------------------------+------------------------------------
Reporter: coldmind | Owner: coldmind
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by dablak):

* cc: dablak (added)


Comment:

+1 This caused headaches because of the cryptic exception.

A way to get around it for now is in settings to comment out the apps
without migrations folder. Then migrate, uncomment the conflicting apps
and finally migrate again.

--
Ticket URL: <https://code.djangoproject.com/ticket/24588#comment:3>

Django

unread,
Apr 16, 2015, 12:32:46 PM4/16/15
to django-...@googlegroups.com
#24588: Improve handling apps without migrations while running migrate command.
--------------------------------------+------------------------------------
Reporter: coldmind | Owner: coldmind
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timgraham):

The situation has likely changed on master (1.9) now that migrations are
compulsory for all apps.

--
Ticket URL: <https://code.djangoproject.com/ticket/24588#comment:4>

Django

unread,
May 14, 2016, 5:41:59 PM5/14/16
to django-...@googlegroups.com
#24588: Improve handling apps without migrations while running migrate command.
--------------------------------------+------------------------------------
Reporter: coldmind | Owner: coldmind
Type: Cleanup/optimization | Status: closed
Component: Migrations | Version: 1.8
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* status: new => closed
* resolution: => wontfix


Comment:

I guess that boat has sailed now.

--
Ticket URL: <https://code.djangoproject.com/ticket/24588#comment:5>

Reply all
Reply to author
Forward
0 new messages