Open
Description
Feature Request
Q | A |
---|---|
New Feature | yes |
RFC | no |
Summary
As of 8.0.13 it's possible to define DEFAULT as an expression:
https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html#data-type-defaults-explicit
Would be nice to allow such behavior.
Context (probably bug):
When we have JSON-type column and field in Entity is nullable=false, MySQL will put default value as literal null
and when decoding JsonType will return NULL
so my property must be nullable while it's undesirable behavior.
IMO best option how to handle this:
- add new key
expression
tooptions
- if
expression===true
do not enquote default value, but instead add parentheses
AR:
CREATE TABLE t1 (
j JSON DEFAULT 'JSON_ARRAY()'
);
ER:
CREATE TABLE t1 (
j JSON DEFAULT (JSON_ARRAY())
);