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 , 9 years ago
Component: | Core (Management commands) → Migrations |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Do you think something like "Conflicting migrations detected (multiple leaf nodes in the migration graph)." would be better?