Upgrading app with settings-dependent migrations

9 views
Skip to first unread message

Jan Musílek

unread,
Aug 23, 2018, 7:30:33 AM8/23/18
to django...@googlegroups.com
Hi!

I have a problem with migrations workflow for which I couldn't find an
answer anywhere else.

Suppose, that I have an application MYAPP, that uses some third-party
apps. These third-party apps require running `makemigrations` command
after adding them to INSTALLED_APPS, because their migrations depend on
settings and therefore can't be distributed right away.

I.e. take `django-modeltranslation` whose migrations depends on
`LANGUAGES` setting or `django-money` whose migrations depends on
`CURRENCIES` setting.

If I was the only user of MYAPP, I would just generate these migrations
depending on my settings and that would be it. What's important that
these migrations belong to application MYAPP, not to third-party apps.

But, I also want to distribute my application MYAPP to other users. I
don't know what they settings will look like, so they'll also need to
generate their own migrations.

Now, I release new version of MYAPP. This version may contain some MYAPP
models related migrations. How should the other users proceed to upgrade
MYAPP to new version and still retain their settings-dependent migrations?

Is there any straightforward elegant solution? Or at least some
nasty/ugly agreed upon "standard" solution? I can't believe that I'm the
only one who has this problem.

Regards,
JM

Tim Graham

unread,
Aug 23, 2018, 9:09:58 AM8/23/18
to Django users
I think that https://code.djangoproject.com/ticket/24648 describes your issue.
Reply all
Reply to author
Forward
0 new messages