Loading core/modules/sqlite/src/Driver/Database/sqlite/Schema.php +5 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,11 @@ public function getFieldTypeMap() { 'blob:big' => 'BLOB', 'blob:normal' => 'BLOB', // Only the SQLite driver has this field map to due to a fatal error // error caused by this driver's schema on table introspection. // @todo Add support to all drivers in https://drupal.org/i/3343634 'json:normal' => 'JSON', ]; return $map; } Loading core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php +10 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,16 @@ public function testSchema(): void { // Test the primary key columns. $this->assertSame(['test_serial', 'test_composite_primary_key'], $method->invoke($this->schema, 'test_table')); // Test adding and removing JSON column. $this->schema->addField('test_table', 'test_json', [ 'description' => 'I heard you liked JSON.', 'type' => 'json', 'pgsql_type' => 'jsonb', 'mysql_type' => 'json', 'sqlite_type' => 'json', ]); $this->schema->dropField('test_table', 'test_json'); // Test renaming of keys and constraints. $this->schema->dropTable('test_table'); $table_specification = [ Loading Loading
core/modules/sqlite/src/Driver/Database/sqlite/Schema.php +5 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,11 @@ public function getFieldTypeMap() { 'blob:big' => 'BLOB', 'blob:normal' => 'BLOB', // Only the SQLite driver has this field map to due to a fatal error // error caused by this driver's schema on table introspection. // @todo Add support to all drivers in https://drupal.org/i/3343634 'json:normal' => 'JSON', ]; return $map; } Loading
core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php +10 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,16 @@ public function testSchema(): void { // Test the primary key columns. $this->assertSame(['test_serial', 'test_composite_primary_key'], $method->invoke($this->schema, 'test_table')); // Test adding and removing JSON column. $this->schema->addField('test_table', 'test_json', [ 'description' => 'I heard you liked JSON.', 'type' => 'json', 'pgsql_type' => 'jsonb', 'mysql_type' => 'json', 'sqlite_type' => 'json', ]); $this->schema->dropField('test_table', 'test_json'); // Test renaming of keys and constraints. $this->schema->dropTable('test_table'); $table_specification = [ Loading