Skip to content

Commit

Permalink
Adding support to parsing json columns in potgres
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 19, 2016
1 parent 46c3fca commit 518ac1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Database/Schema/PostgresSchema.php
Expand Up @@ -129,6 +129,11 @@ protected function _convertColumn($column)
) {
return ['type' => 'decimal', 'length' => null];
}

if (strpos($col, 'json') !== false) {
return ['type' => 'json', 'length' => null];
}

return ['type' => 'text', 'length' => null];
}

Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase/Database/Schema/PostgresSchemaTest.php
Expand Up @@ -200,6 +200,10 @@ public static function convertColumnProvider()
'DOUBLE PRECISION',
['type' => 'float', 'length' => null]
],
[
'JSON',
['type' => 'json', 'length' => null]
],
];
}

Expand Down

0 comments on commit 518ac1b

Please sign in to comment.