Skip to content

Commit

Permalink
Fix 'point' type being interpreted as int.
Browse files Browse the repository at this point in the history
Fallback to 'string' until we can properly sort out how to handle point
types.

Fixes #2953
  • Loading branch information
markstory committed Apr 2, 2014
1 parent 9584cc9 commit 211371d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Schema/MysqlSchema.php
Expand Up @@ -80,7 +80,7 @@ protected function _convertColumn($column) {
if (strpos($col, 'bigint') !== false || $col === 'bigint') {
return ['type' => 'biginteger', 'length' => $length, 'unsigned' => $unsigned];
}
if (strpos($col, 'int') !== false) {
if (in_array($col, ['int', 'integer', 'tinyint', 'smallint', 'mediumint'])) {
return ['type' => 'integer', 'length' => $length, 'unsigned' => $unsigned];
}
if ($col === 'char' && $length === 36) {
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase/Database/Schema/MysqlSchemaTest.php
Expand Up @@ -67,6 +67,10 @@ public static function convertColumnProvider() {
'INTEGER(11)',
['type' => 'integer', 'length' => 11, 'unsigned' => false]
],
[
'MEDIUMINT(11)',
['type' => 'integer', 'length' => 11, 'unsigned' => false]
],
[
'INTEGER(11) UNSIGNED',
['type' => 'integer', 'length' => 11, 'unsigned' => true]
Expand Down

0 comments on commit 211371d

Please sign in to comment.