-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Stop automatically creating migrations on certain fields #4201
Comments
I'd say I'm -1 on this probably. What about a CI check that does something similar to:
(We don't have a django version that supports this yet) Similar: https://gist.github.com/nealtodd/a8f87b0d95e73eb482c5 A simple test case could error out when a migration is required. |
Thats good and all, but it still leaves a tangled mess of migration filenames and PR's. We end up with a bunch of PR's with migrations that are out of order, and that require additional work to clean up, with no real value as a migration since they don't effect DB state. What is the value of having a bunch of migrations that don't actually do anything to the DB state? |
I'd be against of hacking the I'd say that we want to have both things:
Since it seems there is not a better solution for this, I'd go over the monkey patch one which we could improve later if we find a better one. |
I think this is 2 phase. Fix the current errors, then use CI to ensure that any new changes that should incur a migration make a corresponding migration. The fact that we have missing migrations now is a secondary issue -- the main issue is that users don't know they need to create these when making changes, linting. Out of order/etc migrations would all be picked up in review. Hacking makemigrations sounds like a scary, maybe breaking step when compared to just CI failure. |
I understand the annoyance when changing content of text but some of these are from different types which are worth to fix imho. |
This is going stale, so we should either accept or close it probably. I'm -1 on monkeypatching, as i think it will give us different problems or inconsistencies. I hesitate getting too creative with anything that touches out db at such a low level. We can easily add the missing migrations, but to automate for future consistency, i think a simple CI check to fail PRs without necessary migraitons solves the problem we have. |
+1 on CI check |
We have this migrations to apply before we can do something, the migrations for
|
@stsewd what is tricky about the integrations? Looks like it's just adding options? |
@ericholscher the integrations app is creating models |
Just proxy models, no? |
Yeah, looks like so |
Currently we get a bunch of junk migrations when we rename
help_text
orchoices
in a model. I don't think these are actually useful, and we should find a way to stop them.There is a suggestion presented here: https://stackoverflow.com/a/39801321 -- it basically monkey-patches the Django migrations to ignore these fields. I'm not in love with this solution, but I also think we should find a way to fix this, as it causes a lot of issues with new contributors.
The text was updated successfully, but these errors were encountered: