Since Django 1.8 the makemigrations
command has a --name, -n
option to specify custom name for the created migrations file.
I'd like to know whether it's safe in older versions of Django to create the migrations file with the automatically generated name and then rename the file manually. It seems to work as expected. Are there any potential risks?
This works, with a minor caveat: Django will no longer know that the renamed migration is applied.
So the steps to renaming a migration are:
--fake
. If it's a brand new migration, 2 and 3 won't apply, and it's perfectly fine to rename them.