Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#28004 closed Cleanup/optimization (fixed)

Document how to add migrations to an app

Reported by: René Fleschenberg Owned by: rene@…
Component: Documentation Version: 1.10
Severity: Normal Keywords: docs migrations
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (6)

comment:1 by René Fleschenberg, 8 years ago

Needs documentation: set

comment:2 by Tim Graham, 8 years ago

Easy pickings: unset
Has patch: set
Needs documentation: unset
Triage Stage: UnreviewedAccepted

Does this PR give the missing advice?

comment:3 by René Fleschenberg, 8 years ago

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.

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In 7b53041:

Fixed #28004 -- Doc'd how to create migrations for an app without a migrations directory.

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

In 0a8dbd9c:

[1.11.x] Fixed #28004 -- Doc'd how to create migrations for an app without a migrations directory.

Backport of 7b53041420009ad430035116c25f36804e714cd5 from master

comment:6 by Tim Graham, 8 years ago

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.

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