Unverified Commit 40cc9bd5 authored by Grégoire Paris's avatar Grégoire Paris Committed by GitHub

Merge pull request #3912 from morozov/versioned-platform-classes

Made some platform class names reflect the lowest server version they support
parents f82f5c5b bd87aa64
# Upgrade to 3.0 # Upgrade to 3.0
## BC BREAK: Removed support for SQL Anywhere 12 and older
DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer SQL Anywhere version (16+).
The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLAnywherePlatform`
* `Doctrine\DBAL\Platforms\SQLAnywhere11Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere12Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords`
## BC BREAK: Removed support for PostgreSQL 9.3 and older ## BC BREAK: Removed support for PostgreSQL 9.3 and older
DBAL now requires PostgeSQL 9.4 or newer, support for unmaintained versions has been dropped. DBAL now requires PostgreSQL 9.4 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer PostgreSQL version (9.6+ is recommended). If you are using any of the legacy versions, you have to upgrade to a newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent PostgreSQL 9.4.
The following classes have been removed: The following classes have been removed:
* `Doctrine\DBAL\Platforms\PostgreSQL94Platform` * `Doctrine\DBAL\Platforms\PostgreSqlPlatform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords` * `Doctrine\DBAL\Platforms\PostgreSQL91Platform`
* `Doctrine\DBAL\Platforms\PostgreSQL92Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords`
## BC BREAK: Removed support for MariaDB 10.0 and older ## BC BREAK: Removed support for MariaDB 10.0 and older
...@@ -37,51 +54,22 @@ The following class has been removed: ...@@ -37,51 +54,22 @@ The following class has been removed:
* `Doctrine\DBAL\Driver\PDOIbm\Driver` * `Doctrine\DBAL\Driver\PDOIbm\Driver`
## BC BREAK: Removed support for SQL Anywhere 12 and older
DBAL now requires SQL Anywhere 16 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer SQL Anywhere version (16+).
`Doctrine\DBAL\Platforms\SQLAnywherePlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords` now represent SQL Anywhere 16.
The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLAnywhere11Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere12Platform`
* `Doctrine\DBAL\Platforms\SQLAnywhere16Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords`
## BC BREAK: Removed support for SQL Server 2008 and older ## BC BREAK: Removed support for SQL Server 2008 and older
DBAL now requires SQL Server 2012 or newer, support for unmaintained versions has been dropped. DBAL now requires SQL Server 2012 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer SQL Server version. If you are using any of the legacy versions, you have to upgrade to a newer SQL Server version.
`Doctrine\DBAL\Platforms\SQLServerPlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords` now represent SQL Server 2012.
The following classes have been removed: The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLServerPlatform`
* `Doctrine\DBAL\Platforms\SQLServer2005Platform` * `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform` * `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\SQLServer2012Platform` * `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords` * `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords` * `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords`
The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface. The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface.
## BC BREAK: Removed support for PostgreSQL 9.2 and older
DBAL now requires PostgeSQL 9.3 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to a newer PostgreSQL version (9.6+ is recommended).
`Doctrine\DBAL\Platforms\PostgreSqlPlatform` and `Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords` now represent PostgreSQL 9.3.
The following classes have been removed:
* `Doctrine\DBAL\Platforms\PostgreSQL91Platform`
* `Doctrine\DBAL\Platforms\PostgreSQL92Platform`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords`
* `Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords`
## BC BREAK: Removed Doctrine\DBAL\Version ## BC BREAK: Removed Doctrine\DBAL\Version
The `Doctrine\DBAL\Version` class is no longer available: please refrain from checking the DBAL version at runtime. The `Doctrine\DBAL\Version` class is no longer available: please refrain from checking the DBAL version at runtime.
......
...@@ -50,18 +50,18 @@ Oracle ...@@ -50,18 +50,18 @@ Oracle
Microsoft SQL Server Microsoft SQL Server
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
- ``SQLServerPlatform`` for version 2012 and above. - ``SQLServer2012Platform`` for version 2012 and above.
PostgreSQL PostgreSQL
^^^^^^^^^^ ^^^^^^^^^^
- ``PostgreSqlPlatform`` for version 9.4 and above. - ``PostgreSQL94Platform`` for version 9.4 and above.
- ``PostgreSQL100Platform`` for version 10.0 and above. - ``PostgreSQL100Platform`` for version 10.0 and above.
SAP Sybase SQL Anywhere SAP Sybase SQL Anywhere
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
- ``SQLAnywherePlatform`` for version 16 and above. - ``SQLAnywhere16Platform`` for version 16 and above.
SQLite SQLite
^^^^^^ ^^^^^^
......
...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection; ...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager; use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver; use Doctrine\DBAL\VersionAwarePlatformDriver;
use function preg_match; use function preg_match;
...@@ -96,7 +96,7 @@ abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, Ver ...@@ -96,7 +96,7 @@ abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, Ver
return new PostgreSQL100Platform(); return new PostgreSQL100Platform();
} }
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
/** /**
...@@ -114,7 +114,7 @@ abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, Ver ...@@ -114,7 +114,7 @@ abstract class AbstractPostgreSQLDriver implements ExceptionConverterDriver, Ver
*/ */
public function getDatabasePlatform() public function getDatabasePlatform()
{ {
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
/** /**
......
...@@ -5,7 +5,7 @@ namespace Doctrine\DBAL\Driver; ...@@ -5,7 +5,7 @@ namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager; use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver; use Doctrine\DBAL\VersionAwarePlatformDriver;
use function preg_match; use function preg_match;
...@@ -84,7 +84,7 @@ abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, Ve ...@@ -84,7 +84,7 @@ abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, Ve
switch (true) { switch (true) {
default: default:
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
} }
...@@ -103,7 +103,7 @@ abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, Ve ...@@ -103,7 +103,7 @@ abstract class AbstractSQLAnywhereDriver implements ExceptionConverterDriver, Ve
*/ */
public function getDatabasePlatform() public function getDatabasePlatform()
{ {
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
/** /**
......
...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Driver; ...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager;
/** /**
...@@ -27,7 +27,7 @@ abstract class AbstractSQLServerDriver implements Driver ...@@ -27,7 +27,7 @@ abstract class AbstractSQLServerDriver implements Driver
*/ */
public function getDatabasePlatform() public function getDatabasePlatform()
{ {
return new SQLServerPlatform(); return new SQLServer2012Platform();
} }
/** /**
......
...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Platforms\Keywords; ...@@ -7,7 +7,7 @@ namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* PostgreSQL 10.0 reserved keywords list. * PostgreSQL 10.0 reserved keywords list.
*/ */
class PostgreSQL100Keywords extends PostgreSQLKeywords class PostgreSQL100Keywords extends PostgreSQL94Keywords
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* PostgreSQL keywords list. * PostgreSQL 9.4 reserved keywords list.
*/ */
class PostgreSQLKeywords extends KeywordList class PostgreSQL94Keywords extends KeywordList
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
<?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_diff;
use function array_merge;
/**
* SAP Sybase SQL Anywhere 11 reserved keywords list.
*/
class SQLAnywhere11Keywords extends SQLAnywhereKeywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'SQLAnywhere11';
}
/**
* {@inheritdoc}
*
* @link http://dcx.sybase.com/1100/en/dbreference_en11/alhakeywords.html
*/
protected function getKeywords()
{
return array_merge(
array_diff(
parent::getKeywords(),
['IQ']
),
[
'MERGE',
'OPENSTRING',
]
);
}
}
<?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_diff;
use function array_merge;
/**
* SAP Sybase SQL Anywhere 12 reserved keywords list.
*/
class SQLAnywhere12Keywords extends SQLAnywhere11Keywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'SQLAnywhere12';
}
/**
* {@inheritdoc}
*
* @link http://dcx.sybase.com/1200/en/dbreference/alhakeywords.html
*/
protected function getKeywords()
{
return array_merge(
array_diff(
parent::getKeywords(),
[
'INDEX_LPAREN',
'SYNTAX_ERROR',
'WITH_CUBE',
'WITH_LPAREN',
'WITH_ROLLUP',
]
),
[
'DATETIMEOFFSET',
'LIMIT',
'OPENXML',
'SPATIAL',
'TREAT',
]
);
}
}
<?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_merge;
/**
* SAP Sybase SQL Anywhere 16 reserved keywords list.
*/
class SQLAnywhere16Keywords extends SQLAnywhere12Keywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'SQLAnywhere16';
}
/**
* {@inheritdoc}
*
* @link http://dcx.sybase.com/index.html#sa160/en/dbreference/alhakeywords.html
*/
protected function getKeywords()
{
return array_merge(
parent::getKeywords(),
[
'ARRAY',
'JSON',
'ROW',
'ROWTYPE',
'UNNEST',
'VARRAY',
]
);
}
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* SAP Sybase SQL Anywhere 10 reserved keywords list. * SAP Sybase SQL Anywhere 16 reserved keywords list.
*/ */
class SQLAnywhereKeywords extends KeywordList class SQLAnywhereKeywords extends KeywordList
{ {
......
<?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_diff;
use function array_merge;
/**
* Microsoft SQL Server 2005 reserved keyword dictionary.
*
* @link www.doctrine-project.com
*/
class SQLServer2005Keywords extends SQLServerKeywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'SQLServer2005';
}
/**
* {@inheritdoc}
*
* @link http://msdn.microsoft.com/en-US/library/ms189822%28v=sql.90%29.aspx
*/
protected function getKeywords()
{
return array_merge(array_diff(parent::getKeywords(), ['DUMMY']), [
'EXTERNAL',
'PIVOT',
'REVERT',
'SECURITYAUDIT',
'TABLESAMPLE',
'UNPIVOT',
]);
}
}
<?php
namespace Doctrine\DBAL\Platforms\Keywords;
use function array_merge;
/**
* Microsoft SQL Server 2008 reserved keyword dictionary.
*
* @link www.doctrine-project.com
*/
class SQLServer2008Keywords extends SQLServer2005Keywords
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'SQLServer2008';
}
/**
* {@inheritdoc}
*
* @link http://msdn.microsoft.com/en-us/library/ms189822%28v=sql.100%29.aspx
*/
protected function getKeywords()
{
return array_merge(parent::getKeywords(), ['MERGE']);
}
}
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* Microsoft SQL Server 2000 reserved keyword dictionary. * Microsoft SQL Server 2012 reserved keyword dictionary.
*
* @link www.doctrine-project.com
*/ */
class SQLServerKeywords extends KeywordList class SQLServer2012Keywords extends KeywordList
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords; ...@@ -9,7 +9,7 @@ use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
/** /**
* Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform. * Provides the behavior, features and SQL dialect of the PostgreSQL 10.0 database platform.
*/ */
class PostgreSQL100Platform extends PostgreSqlPlatform class PostgreSQL100Platform extends PostgreSQL94Platform
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -34,10 +34,8 @@ use function trim; ...@@ -34,10 +34,8 @@ use function trim;
/** /**
* 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.
*
* @todo Rename: PostgreSQLPlatform
*/ */
class PostgreSqlPlatform extends AbstractPlatform class PostgreSQL94Platform extends AbstractPlatform
{ {
/** @var bool */ /** @var bool */
private $useBooleanTrueFalseStrings = true; private $useBooleanTrueFalseStrings = true;
...@@ -1208,7 +1206,7 @@ SQL ...@@ -1208,7 +1206,7 @@ SQL
*/ */
protected function getReservedKeywordsClass() protected function getReservedKeywordsClass()
{ {
return Keywords\PostgreSQLKeywords::class; return Keywords\PostgreSQL94Keywords::class;
} }
/** /**
......
...@@ -33,10 +33,9 @@ use function strtoupper; ...@@ -33,10 +33,9 @@ use function strtoupper;
use function substr; use function substr;
/** /**
* The SQLAnywherePlatform provides the behavior, features and SQL dialect of the * Provides the behavior, features and SQL dialect of the SAP Sybase SQL Anywhere 16 database platform.
* SAP Sybase SQL Anywhere 16 database platform.
*/ */
class SQLAnywherePlatform extends AbstractPlatform class SQLAnywhere16Platform extends AbstractPlatform
{ {
public const FOREIGN_KEY_MATCH_SIMPLE = 1; public const FOREIGN_KEY_MATCH_SIMPLE = 1;
public const FOREIGN_KEY_MATCH_FULL = 2; public const FOREIGN_KEY_MATCH_FULL = 2;
...@@ -549,7 +548,7 @@ class SQLAnywherePlatform extends AbstractPlatform ...@@ -549,7 +548,7 @@ class SQLAnywherePlatform extends AbstractPlatform
if (! is_string($index)) { if (! is_string($index)) {
throw new InvalidArgumentException( throw new InvalidArgumentException(
'SQLAnywherePlatform::getDropIndexSQL() expects $index parameter to be string or ' . Index::class . '.' 'AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or ' . Index::class . '.'
); );
} }
...@@ -563,7 +562,7 @@ class SQLAnywherePlatform extends AbstractPlatform ...@@ -563,7 +562,7 @@ class SQLAnywherePlatform extends AbstractPlatform
if (! is_string($table)) { if (! is_string($table)) {
throw new InvalidArgumentException( throw new InvalidArgumentException(
'SQLAnywherePlatform::getDropIndexSQL() expects $table parameter to be string or ' . Index::class . '.' 'AbstractPlatform::getDropIndexSQL() expects $table parameter to be string or ' . Index::class . '.'
); );
} }
......
<?php
namespace Doctrine\DBAL\Platforms;
/**
* Platform to ensure compatibility of Doctrine with Microsoft SQL Server 2008 version.
*
* Differences to SQL Server 2005 and before are that a new DATETIME2 type was
* introduced that has a higher precision.
*
* @deprecated Use SQL Server 2012 or newer
*/
class SQLServer2008Platform extends SQLServerPlatform
{
/**
* {@inheritDoc}
*/
public function getListTablesSQL()
{
// "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams
// Category 2 must be ignored as it is "MS SQL Server 'pseudo-system' object[s]" for replication
return "SELECT name, SCHEMA_NAME (uid) AS schema_name FROM sysobjects WHERE type = 'U' AND name != 'sysdiagrams' AND category != 2 ORDER BY name";
}
/**
* {@inheritDoc}
*/
public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration)
{
// 3 - microseconds precision length
// http://msdn.microsoft.com/en-us/library/ms187819.aspx
return 'DATETIME2(6)';
}
/**
* {@inheritDoc}
*/
public function getDateTypeDeclarationSQL(array $fieldDeclaration)
{
return 'DATE';
}
/**
* {@inheritDoc}
*/
public function getTimeTypeDeclarationSQL(array $fieldDeclaration)
{
return 'TIME(0)';
}
/**
* {@inheritDoc}
*/
public function getDateTimeTzTypeDeclarationSQL(array $fieldDeclaration)
{
return 'DATETIMEOFFSET(6)';
}
/**
* {@inheritDoc}
*/
public function getDateTimeFormatString()
{
return 'Y-m-d H:i:s.u';
}
/**
* {@inheritDoc}
*/
public function getDateTimeTzFormatString()
{
return 'Y-m-d H:i:s.u P';
}
/**
* {@inheritDoc}
*/
public function getDateFormatString()
{
return 'Y-m-d';
}
/**
* {@inheritDoc}
*/
public function getTimeFormatString()
{
return 'H:i:s';
}
/**
* {@inheritDoc}
*
* Adding Datetime2 Type
*/
protected function initializeDoctrineTypeMappings()
{
parent::initializeDoctrineTypeMappings();
$this->doctrineTypeMapping['datetime2'] = 'datetime';
$this->doctrineTypeMapping['date'] = 'date';
$this->doctrineTypeMapping['time'] = 'time';
$this->doctrineTypeMapping['datetimeoffset'] = 'datetimetz';
}
/**
* {@inheritdoc}
*
* Returns Microsoft SQL Server 2008 specific keywords class
*/
protected function getReservedKeywordsClass()
{
return Keywords\SQLServer2008Keywords::class;
}
protected function getLikeWildcardCharacters() : string
{
return parent::getLikeWildcardCharacters() . '[]^';
}
}
...@@ -35,10 +35,9 @@ use function strtoupper; ...@@ -35,10 +35,9 @@ use function strtoupper;
use function substr_count; use function substr_count;
/** /**
* The SQLServerPlatform provides the behavior, features and SQL dialect of the * Provides the behavior, features and SQL dialect of the Microsoft SQL Server 2012 database platform.
* Microsoft SQL Server database platform.
*/ */
class SQLServerPlatform extends AbstractPlatform class SQLServer2012Platform extends AbstractPlatform
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
...@@ -1568,7 +1567,7 @@ SQL ...@@ -1568,7 +1567,7 @@ SQL
*/ */
protected function getReservedKeywordsClass() protected function getReservedKeywordsClass()
{ {
return Keywords\SQLServerKeywords::class; return Keywords\SQLServer2012Keywords::class;
} }
/** /**
......
...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Schema; ...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use const CASE_LOWER; use const CASE_LOWER;
...@@ -114,7 +114,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -114,7 +114,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
throw $exception; throw $exception;
} }
assert($this->_platform instanceof PostgreSqlPlatform); assert($this->_platform instanceof PostgreSQL94Platform);
$this->_execSql( $this->_execSql(
[ [
...@@ -494,7 +494,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -494,7 +494,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($tableName);
/** @var PostgreSqlPlatform $platform */ /** @var PostgreSQL94Platform $platform */
$platform = $this->_platform; $platform = $this->_platform;
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($tableName);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Doctrine\DBAL\Schema; namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use function assert; use function assert;
use function is_string; use function is_string;
...@@ -50,7 +50,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager ...@@ -50,7 +50,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
*/ */
public function startDatabase($database) public function startDatabase($database)
{ {
assert($this->_platform instanceof SQLAnywherePlatform); assert($this->_platform instanceof SQLAnywhere16Platform);
$this->_execSql($this->_platform->getStartDatabaseSQL($database)); $this->_execSql($this->_platform->getStartDatabaseSQL($database));
} }
...@@ -61,7 +61,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager ...@@ -61,7 +61,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
*/ */
public function stopDatabase($database) public function stopDatabase($database)
{ {
assert($this->_platform instanceof SQLAnywherePlatform); assert($this->_platform instanceof SQLAnywhere16Platform);
$this->_execSql($this->_platform->getStopDatabaseSQL($database)); $this->_execSql($this->_platform->getStopDatabaseSQL($database));
} }
......
...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Schema; ...@@ -4,7 +4,7 @@ namespace Doctrine\DBAL\Schema;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\DriverException; use Doctrine\DBAL\Driver\DriverException;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use PDOException; use PDOException;
use Throwable; use Throwable;
...@@ -334,7 +334,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager ...@@ -334,7 +334,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($tableName);
/** @var SQLServerPlatform $platform */ /** @var SQLServer2012Platform $platform */
$platform = $this->_platform; $platform = $this->_platform;
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($tableName);
......
...@@ -10,11 +10,11 @@ use Doctrine\DBAL\Platforms\Keywords\MySQL80Keywords; ...@@ -10,11 +10,11 @@ use Doctrine\DBAL\Platforms\Keywords\MySQL80Keywords;
use Doctrine\DBAL\Platforms\Keywords\MySQLKeywords; use Doctrine\DBAL\Platforms\Keywords\MySQLKeywords;
use Doctrine\DBAL\Platforms\Keywords\OracleKeywords; use Doctrine\DBAL\Platforms\Keywords\OracleKeywords;
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords; use Doctrine\DBAL\Platforms\Keywords\PostgreSQL100Keywords;
use Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords; use Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords;
use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator; use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator;
use Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords;
use Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords;
use InvalidArgumentException; use InvalidArgumentException;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
...@@ -34,11 +34,11 @@ class ReservedWordsCommand extends Command ...@@ -34,11 +34,11 @@ class ReservedWordsCommand extends Command
'mysql80' => MySQL80Keywords::class, 'mysql80' => MySQL80Keywords::class,
'mariadb102' => MariaDb102Keywords::class, 'mariadb102' => MariaDb102Keywords::class,
'oracle' => OracleKeywords::class, 'oracle' => OracleKeywords::class,
'pgsql' => PostgreSQLKeywords::class, 'pgsql' => PostgreSQL94Keywords::class,
'pgsql100' => PostgreSQL100Keywords::class, 'pgsql100' => PostgreSQL100Keywords::class,
'sqlanywhere' => SQLAnywhereKeywords::class, 'sqlanywhere' => SQLAnywhereKeywords::class,
'sqlite' => SQLiteKeywords::class, 'sqlite' => SQLiteKeywords::class,
'sqlserver' => SQLServerKeywords::class, 'sqlserver' => SQLServer2012Keywords::class,
]; ];
/** /**
......
...@@ -23,7 +23,7 @@ parameters: ...@@ -23,7 +23,7 @@ parameters:
- '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~' - '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~'
- '~^Method Doctrine\\DBAL\\Schema\\ForeignKeyConstraint::onEvent\(\) should return string\|null but returns false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\ForeignKeyConstraint::onEvent\(\) should return string\|null but returns false\.\z~'
- '~^Method Doctrine\\DBAL\\Schema\\(Oracle|PostgreSql|SQLServer)SchemaManager::_getPortableTableDefinition\(\) should return array but returns string\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\(Oracle|PostgreSql|SQLServer)SchemaManager::_getPortableTableDefinition\(\) should return array but returns string\.\z~'
- '~^Method Doctrine\\DBAL\\Platforms\\(|SQLAnywhere|Sqlite)Platform::_getTransactionIsolationLevelSQL\(\) should return string but returns int\.\z~' - '~^Method Doctrine\\DBAL\\Platforms\\(|SQLAnywhere16|Sqlite)Platform::_getTransactionIsolationLevelSQL\(\) should return string but returns int\.\z~'
- '~^Method Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection::lastInsertId\(\) should return string but returns (int|false)\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection::lastInsertId\(\) should return string but returns (int|false)\.\z~'
- '~^Method Doctrine\\DBAL\\Driver\\SQLSrv\\SQLSrvConnection::errorCode\(\) should return string\|null but returns false\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\SQLSrv\\SQLSrvConnection::errorCode\(\) should return string\|null but returns false\.\z~'
......
...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver; ...@@ -8,7 +8,7 @@ use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\ResultStatement;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager; use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
...@@ -50,7 +50,7 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest ...@@ -50,7 +50,7 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -64,9 +64,9 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest ...@@ -64,9 +64,9 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['9.4', PostgreSqlPlatform::class], ['9.4', PostgreSQL94Platform::class],
['9.4.0', PostgreSqlPlatform::class], ['9.4.0', PostgreSQL94Platform::class],
['9.4.1', PostgreSqlPlatform::class], ['9.4.1', PostgreSQL94Platform::class],
['10', PostgreSQL100Platform::class], ['10', PostgreSQL100Platform::class],
]; ];
} }
......
...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection; ...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractSQLAnywhereDriver; use Doctrine\DBAL\Driver\AbstractSQLAnywhereDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager; use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
...@@ -19,7 +19,7 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest ...@@ -19,7 +19,7 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -33,13 +33,13 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest ...@@ -33,13 +33,13 @@ class AbstractSQLAnywhereDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['16', SQLAnywherePlatform::class], ['16', SQLAnywhere16Platform::class],
['16.0', SQLAnywherePlatform::class], ['16.0', SQLAnywhere16Platform::class],
['16.0.0', SQLAnywherePlatform::class], ['16.0.0', SQLAnywhere16Platform::class],
['16.0.0.0', SQLAnywherePlatform::class], ['16.0.0.0', SQLAnywhere16Platform::class],
['16.1.2.3', SQLAnywherePlatform::class], ['16.1.2.3', SQLAnywhere16Platform::class],
['16.9.9.9', SQLAnywherePlatform::class], ['16.9.9.9', SQLAnywhere16Platform::class],
['17', SQLAnywherePlatform::class], ['17', SQLAnywhere16Platform::class],
]; ];
} }
......
...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection; ...@@ -6,7 +6,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\AbstractSQLServerDriver; use Doctrine\DBAL\Driver\AbstractSQLServerDriver;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager;
...@@ -19,7 +19,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -19,7 +19,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new SQLServerPlatform(); return new SQLServer2012Platform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -33,7 +33,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -33,7 +33,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['12', SQLServerPlatform::class], ['12', SQLServer2012Platform::class],
]; ];
} }
} }
...@@ -10,7 +10,7 @@ use Doctrine\DBAL\DriverManager; ...@@ -10,7 +10,7 @@ use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Doctrine\Tests\TestUtil; use Doctrine\Tests\TestUtil;
...@@ -362,7 +362,7 @@ class ConnectionTest extends DbalFunctionalTestCase ...@@ -362,7 +362,7 @@ class ConnectionTest extends DbalFunctionalTestCase
$platform = $this->connection->getDatabasePlatform(); $platform = $this->connection->getDatabasePlatform();
if ($platform instanceof SqlitePlatform if ($platform instanceof SqlitePlatform
|| $platform instanceof SQLServerPlatform) { || $platform instanceof SQLServer2012Platform) {
self::markTestSkipped('The platform does not support persistent connections'); self::markTestSkipped('The platform does not support persistent connections');
} }
......
...@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Functional\Driver; ...@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Functional\Driver;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded; use function extension_loaded;
...@@ -18,7 +18,7 @@ class PDOPgsqlConnectionTest extends DbalFunctionalTestCase ...@@ -18,7 +18,7 @@ class PDOPgsqlConnectionTest extends DbalFunctionalTestCase
parent::setUp(); parent::setUp();
if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { if ($this->connection->getDatabasePlatform() instanceof PostgreSQL94Platform) {
return; return;
} }
......
...@@ -7,7 +7,7 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection; ...@@ -7,7 +7,7 @@ use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
...@@ -356,7 +356,7 @@ EOT ...@@ -356,7 +356,7 @@ EOT
$this->markTestSkipped('Only skipped if platform is not sqlite'); $this->markTestSkipped('Only skipped if platform is not sqlite');
} }
if ($platform instanceof PostgreSqlPlatform && isset($params['password'])) { if ($platform instanceof PostgreSQL94Platform && isset($params['password'])) {
$this->markTestSkipped('Does not work on Travis'); $this->markTestSkipped('Does not work on Travis');
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Doctrine\Tests\DBAL\Functional\Schema; namespace Doctrine\Tests\DBAL\Functional\Schema;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema; use Doctrine\DBAL\Schema;
use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\ForeignKeyConstraint;
...@@ -401,7 +401,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -401,7 +401,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
*/ */
public function testJsonbColumn(string $type) : void public function testJsonbColumn(string $type) : void
{ {
if (! $this->schemaManager->getDatabasePlatform() instanceof PostgreSqlPlatform) { if (! $this->schemaManager->getDatabasePlatform() instanceof PostgreSQL94Platform) {
$this->markTestSkipped('Requires PostgresSQL 9.4+'); $this->markTestSkipped('Requires PostgresSQL 9.4+');
return; return;
......
...@@ -14,7 +14,7 @@ use Doctrine\DBAL\Types\Type; ...@@ -14,7 +14,7 @@ use Doctrine\DBAL\Types\Type;
use UnexpectedValueException; use UnexpectedValueException;
use function sprintf; use function sprintf;
abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCase abstract class AbstractPostgreSQLPlatformTestCase extends AbstractPlatformTestCase
{ {
public function getGenerateTableSql() : string public function getGenerateTableSql() : string
{ {
......
...@@ -7,7 +7,7 @@ namespace Doctrine\Tests\DBAL\Platforms; ...@@ -7,7 +7,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
class PostgreSQL100PlatformTest extends PostgreSqlPlatformTest class PostgreSQL100PlatformTest extends PostgreSQL94PlatformTest
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
class PostgreSqlPlatformTest extends AbstractPostgreSqlPlatformTestCase class PostgreSQL94PlatformTest extends AbstractPostgreSQLPlatformTestCase
{ {
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new PostgreSqlPlatform(); return new PostgreSQL94Platform();
} }
public function testSupportsPartialIndexes() : void public function testSupportsPartialIndexes() : void
......
...@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Platforms; ...@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\LockMode; use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLAnywherePlatform; use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use Doctrine\DBAL\Platforms\TrimMode; use Doctrine\DBAL\Platforms\TrimMode;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
...@@ -23,14 +23,14 @@ use function mt_rand; ...@@ -23,14 +23,14 @@ use function mt_rand;
use function strlen; use function strlen;
use function substr; use function substr;
class SQLAnywherePlatformTest extends AbstractPlatformTestCase class SQLAnywhere16PlatformTest extends AbstractPlatformTestCase
{ {
/** @var SQLAnywherePlatform */ /** @var SQLAnywhere16Platform */
protected $platform; protected $platform;
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new SQLAnywherePlatform(); return new SQLAnywhere16Platform();
} }
/** /**
...@@ -418,7 +418,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -418,7 +418,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
$this->platform->getForeignKeyDeclarationSQL( $this->platform->getForeignKeyDeclarationSQL(
new ForeignKeyConstraint(['a', 'b'], 'foreign_table', ['c', 'd'], 'fk', [ new ForeignKeyConstraint(['a', 'b'], 'foreign_table', ['c', 'd'], 'fk', [
'notnull' => true, 'notnull' => true,
'match' => SQLAnywherePlatform::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE, 'match' => SQLAnywhere16Platform::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE,
'onUpdate' => 'CASCADE', 'onUpdate' => 'CASCADE',
'onDelete' => 'SET NULL', 'onDelete' => 'SET NULL',
'check_on_commit' => true, 'check_on_commit' => true,
......
<?php
namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServer2008Platform;
class SQLServer2008PlatformTest extends AbstractSQLServerPlatformTestCase
{
public function createPlatform() : AbstractPlatform
{
return new SQLServer2008Platform();
}
public function testGeneratesTypeDeclarationForDateTimeTz() : void
{
self::assertEquals('DATETIMEOFFSET(6)', $this->platform->getDateTimeTzTypeDeclarationSQL([]));
}
}
...@@ -4,13 +4,13 @@ namespace Doctrine\Tests\DBAL\Platforms; ...@@ -4,13 +4,13 @@ namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\LockMode; use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase
{ {
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new SQLServerPlatform(); return new SQLServer2012Platform();
} }
/** /**
......
...@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema; ...@@ -4,7 +4,7 @@ namespace Doctrine\Tests\DBAL\Schema;
use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform; use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
...@@ -121,7 +121,7 @@ class ColumnTest extends TestCase ...@@ -121,7 +121,7 @@ class ColumnTest extends TestCase
$column = new Column('[bar]', $string); $column = new Column('[bar]', $string);
$sqlServerPlatform = new SQLServerPlatform(); $sqlServerPlatform = new SQLServer2012Platform();
self::assertEquals('bar', $column->getName()); self::assertEquals('bar', $column->getName());
self::assertEquals('[bar]', $column->getQuotedName($sqlServerPlatform)); self::assertEquals('[bar]', $column->getQuotedName($sqlServerPlatform));
......
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