#28004 closed Cleanup/optimization (fixed)
Document how to add migrations to an app
Reported by: | René Fleschenberg | Owned by: | |
---|---|---|---|
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 , 8 years ago
Needs documentation: | set |
---|
comment:2 by , 8 years ago
Easy pickings: | unset |
---|---|
Has patch: | set |
Needs documentation: | unset |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 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:6 by , 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.
Does this PR give the missing advice?