Opened 9 years ago

Closed 9 years ago

#25047 closed Cleanup/optimization (fixed)

"Conflicting migrations detected" error in makemigrations is rather unhelpful

Reported by: Niclas Olofsson Owned by: Moses Mugisha
Component: Migrations Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

If you run makemigrations and have more than one migration which no other migration depend upon (a leaf in the dependency graph), you will get the following error

Conflicting migrations detected [0001_migration_a, 0002_migration_b]. To fix them run python manage.py makemigrations --merge

I believe that it is hard to find the cause of this error without looking at the implementation of the checker (https://github.com/django/django/blob/bc77eb6d0858652e197c08c299efaeb06c51efee/django/db/migrations/loader.py#L325).

I suggest that we change "Conflicting migrations detected" to something like "There can only be one migration which are not depended upon by another migration". I would be happy to submit a PR.

Change History (5)

comment:1 by Tim Graham, 9 years ago

Component: Core (Management commands)Migrations
Triage Stage: UnreviewedAccepted

Do you think something like "Conflicting migrations detected (multiple leaf nodes in the migration graph)." would be better?

comment:2 by Moses Mugisha, 9 years ago

Owner: changed from nobody to Moses Mugisha
Status: newassigned

comment:3 by Tim Graham, 9 years ago

Has patch: set

comment:4 by Markus Holtermann, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 45ed19de:

Fixed #25047 -- Improved "Conflicting migrations" error message.

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