[Django] #28004: Document how to add migrations to an app

7 views
Skip to first unread message

Django

unread,
Mar 31, 2017, 6:42:21 PM3/31/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
-------------------------------------+-------------------------------------
Reporter: René | Owner: rene@…
Fleschenberg |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: 1.10
Documentation |
Severity: Normal | Keywords: docs migrations
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
{{{
00:20< moldy> papna: actual output would likely help us to help you :)
00:22< papna> moldy: http://dpaste.com/1D0KT6B
00:23< moldy> papna: ok, so it thinks all migrations are applied
00:24< moldy> papna: which migrations are applied is stored in your sql db
in the django_migrations table
00:24< papna> moldy: If I go into the database, the models from
relationship.models decidedly aren't there.
00:25< moldy> papna: does the relationship app contain a migrations folder
with an __init__.py in it?
00:25< papna> moldy: Some migrations for contenttypes, auth, admin, and
sessions are there
00:25< papna> moldy: It doesn't
00:25< moldy> papna: create it, then run makemigrations
00:26< papna> moldy: There we go.
}}}

I am not sure what exactly the problem is, but this looks like we should
improve our docs.

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

Django

unread,
Mar 31, 2017, 6:43:32 PM3/31/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
-------------------------------------+-------------------------------------
Reporter: René Fleschenberg | Owner: rene@…
Type: | Status: assigned
Cleanup/optimization |
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:

Keywords: docs migrations | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by René Fleschenberg):

* needs_docs: 0 => 1


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

Django

unread,
Mar 31, 2017, 7:12:32 PM3/31/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
--------------------------------------+------------------------------------

Reporter: René Fleschenberg | Owner: rene@…
Type: Cleanup/optimization | Status: assigned

Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: docs migrations | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* needs_docs: 1 => 0
* has_patch: 0 => 1
* easy: 1 => 0
* stage: Unreviewed => Accepted


Comment:

Does this [https://github.com/django/django/pull/8279 PR] give the missing
advice?

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

Django

unread,
Mar 31, 2017, 9:30:12 PM3/31/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
--------------------------------------+------------------------------------
Reporter: René Fleschenberg | Owner: rene@…
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.10
Severity: Normal | Resolution:
Keywords: docs migrations | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by René Fleschenberg):

Tim, thank you for your super-quick reaction!

I now found https://docs.djangoproject.com/en/1.10/topics/migrations
/#adding-migrations-to-apps, which is where I should have pointed the user
at. So this is in fact properly documented already. My bad for not looking
harder, sorry.

On the other hand, papna is (I think) an experienced Python user, so one
could argue that we have a discoverability problem here.

I wonder if we should change the behaviour of `makemigrations` to write
migration files even for apps that don't have a `migrations` package. This
would be less surprising, I think.

In any case, I think this issue is of fairly low priority.

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

Django

unread,
Apr 1, 2017, 2:43:06 PM4/1/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
--------------------------------------+------------------------------------
Reporter: René Fleschenberg | Owner: rene@…
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: docs migrations | Triage Stage: Accepted
Has patch: 1 | 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:"7b53041420009ad430035116c25f36804e714cd5" 7b53041]:
{{{
#!CommitTicketReference repository=""
revision="7b53041420009ad430035116c25f36804e714cd5"
Fixed #28004 -- Doc'd how to create migrations for an app without a
migrations directory.
}}}

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

Django

unread,
Apr 1, 2017, 2:43:50 PM4/1/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
--------------------------------------+------------------------------------
Reporter: René Fleschenberg | Owner: rene@…
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: docs migrations | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

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

In [changeset:"0a8dbd9c2f327bef462f04e3aea7e5100fcfe5af" 0a8dbd9c]:
{{{
#!CommitTicketReference repository=""
revision="0a8dbd9c2f327bef462f04e3aea7e5100fcfe5af"
[1.11.x] Fixed #28004 -- Doc'd how to create migrations for an app without
a migrations directory.

Backport of 7b53041420009ad430035116c25f36804e714cd5 from master
}}}

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

Django

unread,
Apr 1, 2017, 2:47:10 PM4/1/17
to django-...@googlegroups.com
#28004: Document how to add migrations to an app
--------------------------------------+------------------------------------
Reporter: René Fleschenberg | Owner: rene@…
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: docs migrations | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham):

As long as we support apps without migrations (the `migrate --run-syncdb`
option), I don't think should have `makemigrations` write migration files


for apps that don't have a migrations package.

--
Ticket URL: <https://code.djangoproject.com/ticket/28004#comment:6>

Reply all
Reply to author
Forward
0 new messages