Skip to content
Permalink
Browse files

Added integration test for parsing JSON column in postgres

  • Loading branch information...
lorenzo committed Mar 19, 2016
1 parent 792aea8 commit 89ea455f0e2fd748c71db31ac268c459a1d15f01
Showing with 10 additions and 0 deletions.
  1. +1 −0 src/Database/Schema/PostgresSchema.php
  2. +9 −0 tests/TestCase/Database/Schema/PostgresSchemaTest.php
@@ -345,6 +345,7 @@ public function columnSql(Table $table, $name)
'datetime' => ' TIMESTAMP',
'timestamp' => ' TIMESTAMP',
'uuid' => ' UUID',
'json' => ' JSON'
];
if (isset($typeMap[$data['type']])) {
@@ -73,6 +73,7 @@ protected function _createTables($connection)
published BOOLEAN DEFAULT false,
views SMALLINT DEFAULT 0,
readingtime TIME,
data JSON,
created TIMESTAMP,
CONSTRAINT "content_idx" UNIQUE ("title", "body"),
CONSTRAINT "author_idx" FOREIGN KEY ("author_id") REFERENCES "schema_authors" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
@@ -347,6 +348,14 @@ public function testDescribeTable()
'precision' => null,
'comment' => null,
],
'data' => [
'type' => 'json',
'null' => true,
'default' => null,
'length' => null,
'precision' => null,
'comment' => null,
],
'created' => [
'type' => 'timestamp',
'null' => true,

0 comments on commit 89ea455

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