Stop using json_array type on the mapping

Since it was deprecated.
parent 50ddb041
...@@ -21,6 +21,7 @@ namespace Doctrine\DBAL\Platforms; ...@@ -21,6 +21,7 @@ namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\Type;
/** /**
* Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform. * Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
...@@ -89,6 +90,6 @@ class MySQL57Platform extends MySqlPlatform ...@@ -89,6 +90,6 @@ class MySQL57Platform extends MySqlPlatform
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['json'] = 'json_array'; $this->doctrineTypeMapping['json'] = Type::JSON;
} }
} }
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Types\Type;
/** /**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.2 database platform. * Provides the behavior, features and SQL dialect of the PostgreSQL 9.2 database platform.
* *
...@@ -70,7 +72,8 @@ class PostgreSQL92Platform extends PostgreSQL91Platform ...@@ -70,7 +72,8 @@ class PostgreSQL92Platform extends PostgreSQL91Platform
protected function initializeDoctrineTypeMappings() protected function initializeDoctrineTypeMappings()
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['json'] = 'json_array';
$this->doctrineTypeMapping['json'] = Type::JSON;
} }
/** /**
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
namespace Doctrine\DBAL\Platforms; namespace Doctrine\DBAL\Platforms;
use Doctrine\DBAL\Types\Type;
/** /**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.4 database platform. * Provides the behavior, features and SQL dialect of the PostgreSQL 9.4 database platform.
* *
...@@ -54,6 +56,7 @@ class PostgreSQL94Platform extends PostgreSQL92Platform ...@@ -54,6 +56,7 @@ class PostgreSQL94Platform extends PostgreSQL92Platform
protected function initializeDoctrineTypeMappings() protected function initializeDoctrineTypeMappings()
{ {
parent::initializeDoctrineTypeMappings(); parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['jsonb'] = 'json_array';
$this->doctrineTypeMapping['jsonb'] = Type::JSON;
} }
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\MySQL57Platform; use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Types\Type;
class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase
{ {
...@@ -27,7 +28,7 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase ...@@ -27,7 +28,7 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase
public function testInitializesJsonTypeMapping() public function testInitializesJsonTypeMapping()
{ {
$this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('json')); $this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('json'));
$this->assertSame('json_array', $this->_platform->getDoctrineTypeMapping('json')); $this->assertSame(Type::JSON, $this->_platform->getDoctrineTypeMapping('json'));
} }
/** /**
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSQL92Platform; use Doctrine\DBAL\Platforms\PostgreSQL92Platform;
use Doctrine\DBAL\Types\Type;
class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
{ {
...@@ -54,7 +55,7 @@ class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase ...@@ -54,7 +55,7 @@ class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
public function testInitializesJsonTypeMapping() public function testInitializesJsonTypeMapping()
{ {
$this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('json')); $this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('json'));
$this->assertEquals('json_array', $this->_platform->getDoctrineTypeMapping('json')); $this->assertEquals(Type::JSON, $this->_platform->getDoctrineTypeMapping('json'));
} }
/** /**
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Types\Type;
class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest
{ {
...@@ -25,6 +26,6 @@ class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest ...@@ -25,6 +26,6 @@ class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest
{ {
parent::testInitializesJsonTypeMapping(); parent::testInitializesJsonTypeMapping();
$this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('jsonb')); $this->assertTrue($this->_platform->hasDoctrineTypeMappingFor('jsonb'));
$this->assertEquals('json_array', $this->_platform->getDoctrineTypeMapping('jsonb')); $this->assertEquals(Type::JSON, $this->_platform->getDoctrineTypeMapping('jsonb'));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment