3YOURMIND / django-add-default-value

This django Migration Operation can be used to transfer a Fields default value to the database scheme.
Apache License 2.0
138 stars 20 forks source link

Fix/Handle corner case for non_callable mysql_version in can_have_default… #35

Closed rniem379349 closed 3 years ago

rniem379349 commented 3 years ago

This fixes a corner case where the connections' mysql_version attribute is not a callable, and is already pre-calculated before can_have_default_for_text is called. Sometimes this can cause an unexpected exception to occur otherwise.

flixx commented 3 years ago

@rniem379349 Thanks for your contribution! Should I release or can wait until the release gets bigger?

rniem379349 commented 3 years ago

@flixx Thanks for accepting the PR! If it's not too much trouble a release would be cool, because otherwise on some setups django TextFields that have been fixed up with the default value code will still throw up errors if mysql_version is not callable (default behaviour is returning False). However, this is not a breaking issue, since one can just ignore the TextField checks if the default value has been implemented,. So if you prefer you can also wait with the release, no problem.