[Django] #23961: MIGRATION_MODULES and makemigration with no arguments

4 views
Skip to first unread message

Django

unread,
Dec 5, 2014, 6:03:58 AM12/5/14
to django-...@googlegroups.com
#23961: MIGRATION_MODULES and makemigration with no arguments
-------------------------------+-----------------------
Reporter: dibrovsd | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords: migration
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+-----------------------
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

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

Django

unread,
Dec 8, 2014, 7:03:17 PM12/8/14
to django-...@googlegroups.com
#23961: makemigrations doesn't create migrations package when app_label isn't
specified
----------------------------+------------------------------------
Reporter: dibrovsd | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Resolution:
Keywords: migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_tests: => 0
* easy: 1 => 0
* needs_docs: => 0
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


Comment:

It seems the fix for #22682 (allowing `makemigrations` to create the
migrations package) only works if you specify the `app_label`. We should
either update the documentation that was added as part of that ticket (in
`docs/ref/settings.txt`) or see if we can make package creation happen
when using `makemigrations` without an `app_label`.

I couldn't tell if there were any more problems besides that in your
report. If so, a separate ticket may be appropriate.

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

Django

unread,
Dec 8, 2014, 7:33:25 PM12/8/14
to django-...@googlegroups.com
#23961: makemigrations doesn't create migrations package when app_label isn't
specified
----------------------------+------------------------------------
Reporter: dibrovsd | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7

Severity: Normal | Resolution:
Keywords: migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------

Comment (by carljm):

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.

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

Django

unread,
Dec 9, 2014, 7:30:37 AM12/9/14
to django-...@googlegroups.com
#23961: makemigrations doesn't create migrations package when app_label isn't
specified
-------------------------------+-------------------------------------
Reporter: dibrovsd | Owner: timgraham
Type: Bug | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => assigned
* owner: nobody => timgraham
* component: Migrations => Documentation


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

Django

unread,
Dec 9, 2014, 7:31:28 AM12/9/14
to django-...@googlegroups.com
#23961: makemigrations doesn't create migrations package when app_label isn't
specified
-------------------------------+-------------------------------------
Reporter: dibrovsd | Owner: timgraham
Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fa6e3a40e1866b64eb30e0dfbd43b340c0d831da"]:
{{{
#!CommitTicketReference repository=""
revision="fa6e3a40e1866b64eb30e0dfbd43b340c0d831da"
Fixed #23961 -- Clarified when makemigrations will create a directory.
}}}

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

Django

unread,
Dec 9, 2014, 7:31:50 AM12/9/14
to django-...@googlegroups.com
#23961: makemigrations doesn't create migrations package when app_label isn't
specified
-------------------------------+-------------------------------------
Reporter: dibrovsd | Owner: timgraham
Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: migration | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"da562d6a8785d28b75475c1c3d1eb5987253bc35"]:
{{{
#!CommitTicketReference repository=""
revision="da562d6a8785d28b75475c1c3d1eb5987253bc35"
[1.7.x] Fixed #23961 -- Clarified when makemigrations will create a
directory.

Backport of fa6e3a40e1866b64eb30e0dfbd43b340c0d831da from master
}}}

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

Reply all
Reply to author
Forward
0 new messages