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
Fixed #35038 - Changing violation_error_message on constraints cause a remove/add operation in migration #17846
Fixed #35038 - Changing violation_error_message on constraints cause a remove/add operation in migration #17846
Conversation
Just like If is not already a noop at the schema application level we should make one but all attributes should be tracked. In order words, the solution here should not be to avoid detecting changes to some attribute of It seems like we should have an This one is really a pickle, I can see the appeal to do away with discarding some attributes to avoid introducing Maybe it's time to revisit the discussion around not support constraint alteration in the first place and making them Refs ticket-25253 |
@charettes Thanks for explaining. I don't want to introduce code that's different in its design from the rest of the migration code so I'm happy to work on |
@adriennefranke I think it warrants further discussions that I didn't see mentioned on the ticket so I figured I'd chime in. Whether or not adding |
@charettes What would you say the right next steps are? Should I bring it up on the Discord or in the forums? |
I think the forum would be a good location to start a discussion on that yes. |
mutable_self = copy.copy(self) | ||
mutable_self.violation_error_code = None | ||
mutable_self.violation_error_message = None | ||
return mutable_self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @adriennefranke, first timer here on django core - hopped here from the djangocon US talks.
Thanks for the patch, and I think its really an interesting one following the trend of conversations from #17644 and ticket-25253.
In addition, to @charettes, could I suggest sending in a discourse update on the regarding this patch to discord as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@50-Course Yes, I will do that as well. Thanks!
Yes, yes, yes, we need |
Going to close this PR while I work on the |
This reverts commit 59b2985.
Fixes #35038. I created a method within the
BaseConstraint
class that returns a copy of the Constraint object without the two fields (violation_error_code
andviolation_error_message
) that do not affect the DDL. I then call this method increate_altered_constraints
and use that to determine when a migration for constraints is truly necessary.There was another PR that was opened to fix this ticket so here's a link to that for reference.