#23961 closed Bug (fixed)
makemigrations doesn't create migrations package when app_label isn't specified
Reported by: | dibrovsd | Owned by: | Tim Graham |
---|---|---|---|
Component: | Documentation | Version: | 1.7 |
Severity: | Normal | Keywords: | migration |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
in settings:
MIGRATION_MODULES = { 'docflow': 'docflow_projects.migrations', }
case 1) app docflow has no package "migrations"
- ./manage.py makemigrations
initial migration not create
case 2) app docflow has package "migrations"
- run "./manage.py makemigrations"
created initial migration in docflow_projects.migrations 0001_initial (ok)
- run "./manage.py makemigrations"
create migration deleted all field and models in app! 0002_auto_20141205_1349 (error)
- run "./manage.py makemigrations"
raise
CommandError: Conflicting migrations detected (0002_auto_20141205_1349, 0001_initial in docflow).
case 3)
run ./manage.py makemigrations docflow
it's ok
Change History (5)
comment:1 by , 10 years ago
Easy pickings: | unset |
---|---|
Summary: | MIGRATION_MODULES and makemigration with no arguments → makemigrations doesn't create migrations package when app_label isn't specified |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
comment:2 by , 10 years ago
I thought that until support for apps without migrations was removed, it was intentional that makemigrations
would only create the migrations module if you gave it an app-label (I think that's the behavior with or without MIGRATION_MODULES
set). Otherwise it would be very difficult to use migrated apps alongside unmigrated apps in the same project. I think the plan is in Django 1.9 (when support for unmigrated apps goes away), makemigrations should start always creating the migration module.
I'm not entirely sure about that, but that was my understanding. If that's the case, there still may be a documentation update needed.
comment:3 by , 10 years ago
Component: | Migrations → Documentation |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
It seems the fix for #22682 (allowing
makemigrations
to create the migrations package) only works if you specify theapp_label
. We should either update the documentation that was added as part of that ticket (indocs/ref/settings.txt
) or see if we can make package creation happen when usingmakemigrations
without anapp_label
.I couldn't tell if there were any more problems besides that in your report. If so, a separate ticket may be appropriate.