You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a mysql@8.0.21 and i cannot set a JSON default value on one column.
Current behavior
From the entity below, i cannot setup correctly the default value of the column when is declare as json.
Further investigation discover that the orm does an invalid query to mysql:
correct query: CREATE TABLE setting (id INT AUTO_INCREMENT NOT NULL, settings JSON DEFAULT ('{}') NOT NULL, PRIMARY KEY(id))
ORM generated query: CREATE TABLE setting (id INT AUTO_INCREMENT NOT NULL, settings JSON DEFAULT '(''{}'')' NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
Bug Report
Summary
I have a mysql@8.0.21 and i cannot set a JSON default value on one column.
Current behavior
From the entity below, i cannot setup correctly the default value of the column when is declare as json.
Further investigation discover that the orm does an invalid query to mysql:
CREATE TABLE setting (id INT AUTO_INCREMENT NOT NULL, settings JSON DEFAULT ('{}') NOT NULL, PRIMARY KEY(id))
CREATE TABLE setting (id INT AUTO_INCREMENT NOT NULL, settings JSON DEFAULT '(''{}'')' NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
mysql docs
How to reproduce
setting.php
composer.json
Pipeline to inizialize the database
Expected behavior
I aspect to have the column of type json with the default json. I can resolve the problem by using migration but is not scalable...
The text was updated successfully, but these errors were encountered: