On MySQL, text
, blob
, json
, and the short
/medium
/long
varieties of the first two are forbidden from having default values.
Django Evolution would try to apply these anyway when adding a non-NULL
field or changing a field to be non-NULL (and in fact validated that
such a value would be provided when setting to non-NULL). This would
prevent these types of fields from being added unless they were set to
allow NULL.
Now, the evolution op backends can override a
get_field_type_allows_default()
method, which can check a field to
determine if default values should be allowed. This is used when
building a column schema definition, ensuring that any DEFAULT
-related
SQL is omitted if not allowed for the field.