cancel
Showing results for 
Search instead for 
Did you mean: 

Support for JSON Data Type in MySQL.

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Support for JSON Data Type in MySQL.

When creating tables in Module/Setup/InstallSchema.php I would like "Magento\Framework\DB\Ddl\Table.php" to support the JSON data type as it has its advantages. For DBs that do not have a JSON data type, they can default to text.

 

At the moment I need to add my column manually to enable the usage of the JSON data type.

$sql = <<<EOT
  ALTER TABLE my_table ADD COLUMN column_name JSON NOT NULL
  AFTER a_table_column;
EOT;
$connection->query($sql);