Skip to content
Permalink
Browse files

Adding support for detecting JSON columns in mysql

  • Loading branch information...
lorenzo committed Mar 19, 2016
1 parent 20d5908 commit 46c3fca9a83936ae767ea783f1076eb7fa8ef784
Showing with 9 additions and 0 deletions.
  1. +5 −0 src/Database/Schema/MysqlSchema.php
  2. +4 −0 tests/TestCase/Database/Schema/MysqlSchemaTest.php
@@ -137,6 +137,11 @@ protected function _convertColumn($column)
'unsigned' => $unsigned
];
}
if (strpos($col, 'json') !== false) {
return ['type' => 'json', 'length' => null];
}
return ['type' => 'text', 'length' => null];
}
@@ -146,6 +146,10 @@ public static function convertColumnProvider()
'DOUBLE(10,4) UNSIGNED',
['type' => 'float', 'length' => 10, 'precision' => 4, 'unsigned' => true]
],
[
'JSON',
['type' => 'json', 'length' => null]
],
];
}

0 comments on commit 46c3fca

Please sign in to comment.
You can’t perform that action at this time.