Skip to content
Permalink
Browse files

fallbacking json types to TEXT in sqlite

  • Loading branch information...
lorenzo committed Mar 19, 2016
1 parent fd566fd commit b81505d86cbc3b1ef9d7e03dda1973f57abb329b
Showing with 3 additions and 0 deletions.
  1. +1 −0 src/Database/Schema/SqliteSchema.php
  2. +2 −0 tests/TestCase/Database/Schema/SqliteSchemaTest.php
@@ -257,6 +257,7 @@ public function columnSql(Table $table, $name)
'time' => ' TIME',
'datetime' => ' DATETIME',
'timestamp' => ' TIMESTAMP',
'json' => ' TEXT'
];
if (!isset($typeMap[$data['type']])) {
throw new Exception(sprintf('Unknown column type for "%s"', $name));
@@ -776,6 +776,7 @@ public function testCreateSql()
'null' => false,
])
->addColumn('body', ['type' => 'text'])
->addColumn('data', ['type' => 'json'])
->addColumn('created', 'datetime')
->addConstraint('primary', [
'type' => 'primary',
@@ -791,6 +792,7 @@ public function testCreateSql()
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" VARCHAR NOT NULL,
"body" TEXT,
"data" TEXT,
"created" DATETIME
)
SQL;

0 comments on commit b81505d

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