Opened 9 years ago
Closed 9 years ago
#25944 closed New feature (wontfix)
Add the ability to specify which app a migration should be created in
Reported by: | Ramez Issac | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | ramezashraf@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Use case:
A third party app allow for "dynamic model loading" (where you can specify one of its base model via something like THIRD_PARTY_BASE_MODEL = 'myapp.CustomBase'
in settings.py)
Then, when running makemigrations
the migration file goes to the 3rd party migrations folder (probably in the virtualenv) and unless manual care taken to copy the migration file to the main app, renaming etc. , it will lead to a complicated situation.
Change History (5)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Thanks and excuse my English :)
I meant is "Put the newly created migration file in a specified app migrations folder instead of its 'normal' place"
So, for example, i can write something like makemigrations --to-app=myapp
so the output 0002_auto_something.py file goes to myapp/migrations, instead of thirdparty_package/migrations
comment:3 by , 9 years ago
Summary: | Allow to tunnel migration to specific app → Add the ability to specify which app a migration should be created in |
---|
A similar idea was discussed at some length on django-developers. I think the consensus was to use MIGRATION_MODULES
to solve this case, but feel free to take a look and add your thoughts.
comment:4 by , 9 years ago
Ooh dear Tim, thank you for pointing this conversation out.
I withdraw.. MIGRATION_MODULES
it is...
comment:5 by , 9 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I think you might have an incorrect word choice in "tunnel" -- not sure what that means in this context. Can you describe what the feature would look like?