Opened 8 years ago

Closed 8 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 Tim Graham, 8 years ago

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?

comment:2 by Ramez Issac, 8 years ago

Thanks and excuse my English :)
What 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

Last edited 8 years ago by Ramez Issac (previous) (diff)

comment:3 by Tim Graham, 8 years ago

Summary: Allow to tunnel migration to specific appAdd 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 Ramez Issac, 8 years ago

Ooh dear Tim, thank you for pointing this conversation out.
I withdraw.. MIGRATION_MODULES it is...

comment:5 by Tim Graham, 8 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top