consumerfinance.gov icon indicating copy to clipboard operation
consumerfinance.gov copied to clipboard

Disallow unnamed (autonamed) migrations?

Open Scotchester opened this issue 4 years ago • 3 comments

We could prevent autogenerated migration filenames, if we want:

https://adamj.eu/tech/2020/02/24/how-to-disallow-auto-named-django-migrations/

Scotchester avatar Mar 08 '20 15:03 Scotchester

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.

willbarton avatar Mar 09 '20 13:03 willbarton

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?

higs4281 avatar Mar 09 '20 13:03 higs4281

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.

chosak avatar Mar 09 '20 15:03 chosak