Opened 7 years ago

Closed 7 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 Changed 7 years ago by Tim Graham

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 Changed 7 years ago by Ramez Issac

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

Version 0, edited 7 years ago by Ramez Issac (next)

comment:3 Changed 7 years ago by Tim Graham

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 Changed 7 years ago by Ramez Issac

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

comment:5 Changed 7 years ago by Tim Graham

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