Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow unnamed (autonamed) migrations? #5558

Open
Scotchester opened this issue Mar 8, 2020 · 3 comments
Open

Disallow unnamed (autonamed) migrations? #5558

Scotchester opened this issue Mar 8, 2020 · 3 comments

Comments

@Scotchester
Copy link
Contributor

We could prevent autogenerated migration filenames, if we want:

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

@willbarton
Copy link
Member

willbarton commented Mar 9, 2020

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.

@higs4281
Copy link
Member

higs4281 commented Mar 9, 2020

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?

@chosak
Copy link
Member

chosak commented Mar 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants