Opened 10 years ago

Closed 9 years ago

#24588 closed Cleanup/optimization (wontfix)

Improve handling apps without migrations while running migrate command.

Reported by: Andriy Sokolovskiy Owned by: Andriy Sokolovskiy
Component: Migrations Version: 1.8
Severity: Normal Keywords:
Cc: Daniel Blasco Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (5)

comment:1 by Claude Paroz, 10 years ago

Triage Stage: UnreviewedAccepted
Type: New featureCleanup/optimization

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

comment:2 by Andriy Sokolovskiy, 10 years ago

I will work on patch

Last edited 10 years ago by Andriy Sokolovskiy (previous) (diff)

comment:3 by Daniel Blasco, 10 years ago

Cc: Daniel Blasco added

+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.

comment:4 by Tim Graham, 10 years ago

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

comment:5 by Claude Paroz, 9 years ago

Resolution: wontfix
Status: newclosed

I guess that boat has sailed now.

Note: See TracTickets for help on using tickets.
Back to Top