问题
what i'm trying to do is to change the default path for migrations for a specific application in a django project to put it outside the project itself but keeping it transparent, keeping use of makemigrations and migrate. Is it possible? if yes, how?
回答1:
Django has a MIGRATION_MODULES setting. It allows you to specify a different module for migrations per app. The module can be outside of the Django project, it just needs to be on your python path.
MIGRATION_MODULES = {'myapp': 'othermodule.db_migrations'}
来源:https://stackoverflow.com/questions/46486260/is-it-possible-to-change-the-migrations-folders-location-outside-of-the-djang