Pergunta

In django 1.7, using the provided makemigrations command(not from South), is there a way to change the location of where the generated migration files are stored?

I'm keeping these files under version control and for apps imported from Django's contrib, they get generated right inside the app directory, which resides outside my project's root path.

For example, the auth app gets the files generated in this location in my case:

/home/dev/.envs/myproj/lib/python2.7/site-packages/django/contrib/auth/migrations/0002_group.py

Thanks

Foi útil?

Solução

It's done via MIGRATION_MODULES setting.

In my case:

MIGRATION_MODULES = dict([(app, 'migrations.' + app) for app in INSTALLED_APPS])

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top