consumerfinance.gov
consumerfinance.gov copied to clipboard
Disallow unnamed (autonamed) migrations?
We could prevent autogenerated migration filenames, if we want:
https://adamj.eu/tech/2020/02/24/how-to-disallow-auto-named-django-migrations/
I like the idea of using django-test-migrations or a custom system check a lot better than overriding the management command or relying on commit hooks.
But I definitely think this is something we should do.
Good find, @Scotchester
It would also help just to spread knowledge of the --name
option. Worth a reference in https://github.com/cfpb/development/tree/master/standards?
One minor request if we decide to implement this: can we make sure that devs can still use auto-named migrations when working locally? I often generate temporary migrations while working and only finalize when getting ready to commit/push up. We currently have some (admittedly hacky) logic that fails tox if there are missing migrations when run on Travis, but not when run locally -- perhaps we could do something similar with this check.