Unverified Commit e17efdc9 authored by Michael Moravec's avatar Michael Moravec Committed by Sergei Morozov

Drop support for SQL Server <2008

parent faefe46d
# Upgrade to 3.0 # Upgrade to 3.0
## BC BREAK: Removed support for SQL Server 2005 and older
DBAL now requires SQL Server 2008 or newer, support for unmaintained versions has been dropped.
If you are using any of the legacy versions, you have to upgrade to newer SQL Server version (2012+ is recommended).
`Doctrine\DBAL\Platforms\SQLServerPlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords` now represent the SQL Server 2008.
The following classes have been removed:
* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`
## BC BREAK: Removed support for PostgreSQL 9.2 and older ## 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. DBAL now requires PostgeSQL 9.3 or newer, support for unmaintained versions has been dropped.
......
...@@ -50,9 +50,7 @@ Oracle ...@@ -50,9 +50,7 @@ Oracle
Microsoft SQL Server Microsoft SQL Server
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
- ``SQLServerPlatform`` for version 2000 and above. - ``SQLServerPlatform`` for version 2008 and above.
- ``SQLServer2005Platform`` for version 2005 and above.
- ``SQLServer2008Platform`` for version 2008 and above.
- ``SQLServer2012Platform`` for version 2012 and above. - ``SQLServer2012Platform`` for version 2012 and above.
PostgreSQL PostgreSQL
......
...@@ -677,9 +677,7 @@ Please also notice the mapping specific footnotes for additional information. ...@@ -677,9 +677,7 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+ | | | | +--------------------------+ | |
| | | **SQLite** | | | | | | **SQLite** | | |
| | +--------------------------+---------+ | | | +--------------------------+---------+ |
| | | **SQL Server** | >= 2008 | | | | | **SQL Server** | "all" | |
| | | +---------+----------------------------------------------------------+
| | | | < 2008 | ``DATETIME`` [15]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **datetime** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [13]_ | | **datetime** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [13]_ |
| | +--------------------------+---------+----------------------------------------------------------+ | | +--------------------------+---------+----------------------------------------------------------+
...@@ -697,9 +695,7 @@ Please also notice the mapping specific footnotes for additional information. ...@@ -697,9 +695,7 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+ | | | | +--------------------------+ | |
| | | **SQLite** | | | | | | **SQLite** | | |
| | +--------------------------+---------+ | | | +--------------------------+---------+ |
| | | **SQL Server** | < 2008 | | | | | **SQL Server** | "all" | |
| | | +---------+----------------------------------------------------------+
| | | | >= 2008 | ``DATETIMEOFFSET(6)`` |
| | +--------------------------+---------+----------------------------------------------------------+ | | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``TIMESTAMP(0) WITH TIME ZONE`` | | | | **PostgreSQL** | *all* | ``TIMESTAMP(0) WITH TIME ZONE`` |
| | +--------------------------+ | | | | +--------------------------+ | |
...@@ -719,9 +715,7 @@ Please also notice the mapping specific footnotes for additional information. ...@@ -719,9 +715,7 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+ | | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``DATE`` [15]_ | | | | **Oracle** | *all* | ``DATE`` [15]_ |
| | +--------------------------+---------+----------------------------------------------------------+ | | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | < 2008 | ``DATETIME`` [15]_ | | | | **SQL Server** | "all" | ``TIME(0)`` |
| | | +---------+----------------------------------------------------------+
| | | | >= 2008 | ``TIME(0)`` |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+ +-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **array** [1]_ | ``array`` | **MySQL** | *all* | ``TINYTEXT`` [16]_ | | **array** [1]_ | ``array`` | **MySQL** | *all* | ``TINYTEXT`` [16]_ |
+-------------------+ | | +----------------------------------------------------------+ +-------------------+ | | +----------------------------------------------------------+
......
...@@ -5,8 +5,6 @@ namespace Doctrine\DBAL\Driver; ...@@ -5,8 +5,6 @@ namespace Doctrine\DBAL\Driver;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\SQLServer2005Platform;
use Doctrine\DBAL\Platforms\SQLServer2008Platform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Schema\SQLServerSchemaManager; use Doctrine\DBAL\Schema\SQLServerSchemaManager;
...@@ -44,10 +42,6 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr ...@@ -44,10 +42,6 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr
switch (true) { switch (true) {
case version_compare($version, '11.00.2100', '>='): case version_compare($version, '11.00.2100', '>='):
return new SQLServer2012Platform(); return new SQLServer2012Platform();
case version_compare($version, '10.00.1600', '>='):
return new SQLServer2008Platform();
case version_compare($version, '9.00.1399', '>='):
return new SQLServer2005Platform();
default: default:
return new SQLServerPlatform(); return new SQLServerPlatform();
} }
...@@ -68,7 +62,7 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr ...@@ -68,7 +62,7 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr
*/ */
public function getDatabasePlatform() public function getDatabasePlatform()
{ {
return new SQLServer2008Platform(); return new SQLServerPlatform();
} }
/** /**
......
<?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']);
}
}
...@@ -9,7 +9,7 @@ use function array_merge; ...@@ -9,7 +9,7 @@ use function array_merge;
* *
* @link www.doctrine-project.com * @link www.doctrine-project.com
*/ */
class SQLServer2012Keywords extends SQLServer2008Keywords class SQLServer2012Keywords extends SQLServerKeywords
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -121,6 +121,7 @@ class SQLServerKeywords extends KeywordList ...@@ -121,6 +121,7 @@ class SQLServerKeywords extends KeywordList
'LIKE', 'LIKE',
'LINENO', 'LINENO',
'LOAD', 'LOAD',
'MERGE',
'NATIONAL', 'NATIONAL',
'NOCHECK ', 'NOCHECK ',
'NONCLUSTERED', 'NONCLUSTERED',
......
...@@ -11,7 +11,7 @@ use Doctrine\DBAL\Schema\Table; ...@@ -11,7 +11,7 @@ use Doctrine\DBAL\Schema\Table;
* *
* - Create tables with the FEDERATED ON syntax. * - Create tables with the FEDERATED ON syntax.
*/ */
class SQLAzurePlatform extends SQLServer2008Platform class SQLAzurePlatform extends SQLServerPlatform
{ {
/** /**
* {@inheritDoc} * {@inheritDoc}
......
<?php
namespace Doctrine\DBAL\Platforms;
/**
* Platform to ensure compatibility of Doctrine with Microsoft SQL Server 2005 version and
* higher.
*
* Differences to SQL Server 2008 are:
*
* - DATETIME2 datatype does not exist, only DATETIME which has a precision of
* 3. This is not supported by PHP DateTime, so we are emulating it by
* setting .000 manually.
* - Starting with SQLServer2005 VARCHAR(MAX), VARBINARY(MAX) and
* NVARCHAR(max) replace the old TEXT, NTEXT and IMAGE types. See
* {@link http://www.sql-server-helper.com/faq/sql-server-2005-varchar-max-p01.aspx}
* for more information.
*/
class SQLServer2005Platform extends SQLServerPlatform
{
/**
* {@inheritDoc}
*/
public function supportsLimitOffset()
{
return true;
}
/**
* {@inheritDoc}
*/
public function getClobTypeDeclarationSQL(array $field)
{
return 'VARCHAR(MAX)';
}
/**
* {@inheritdoc}
*
* Returns Microsoft SQL Server 2005 specific keywords class
*/
protected function getReservedKeywordsClass()
{
return Keywords\SQLServer2005Keywords::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.
*/
class SQLServer2008Platform extends SQLServer2005Platform
{
/**
* {@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() . '[]^';
}
}
...@@ -14,7 +14,7 @@ use function substr_count; ...@@ -14,7 +14,7 @@ use function substr_count;
* Differences to SQL Server 2008 and before are that sequences are introduced, * Differences to SQL Server 2008 and before are that sequences are introduced,
* and support for the new OFFSET... FETCH syntax for result pagination has been added. * and support for the new OFFSET... FETCH syntax for result pagination has been added.
*/ */
class SQLServer2012Platform extends SQLServer2008Platform class SQLServer2012Platform extends SQLServerPlatform
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
......
...@@ -884,7 +884,7 @@ SQL ...@@ -884,7 +884,7 @@ SQL
{ {
// "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams // "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 // Category 2 must be ignored as it is "MS SQL Server 'pseudo-system' object[s]" for replication
return "SELECT name FROM sysobjects WHERE type = 'U' AND name != 'sysdiagrams' AND category != 2 ORDER BY name"; return "SELECT name, SCHEMA_NAME (uid) AS schema_name FROM sysobjects WHERE type = 'U' AND name != 'sysdiagrams' AND category != 2 ORDER BY name";
} }
/** /**
...@@ -1172,6 +1172,14 @@ SQL ...@@ -1172,6 +1172,14 @@ SQL
return 'UNIQUEIDENTIFIER'; return 'UNIQUEIDENTIFIER';
} }
/**
* {@inheritDoc}
*/
public function getDateTimeTzTypeDeclarationSQL(array $fieldDeclaration)
{
return 'DATETIMEOFFSET(6)';
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
...@@ -1217,7 +1225,9 @@ SQL ...@@ -1217,7 +1225,9 @@ SQL
*/ */
public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration) public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration)
{ {
return 'DATETIME'; // 3 - microseconds precision length
// http://msdn.microsoft.com/en-us/library/ms187819.aspx
return 'DATETIME2(6)';
} }
/** /**
...@@ -1225,7 +1235,7 @@ SQL ...@@ -1225,7 +1235,7 @@ SQL
*/ */
public function getDateTypeDeclarationSQL(array $fieldDeclaration) public function getDateTypeDeclarationSQL(array $fieldDeclaration)
{ {
return 'DATETIME'; return 'DATE';
} }
/** /**
...@@ -1233,7 +1243,7 @@ SQL ...@@ -1233,7 +1243,7 @@ SQL
*/ */
public function getTimeTypeDeclarationSQL(array $fieldDeclaration) public function getTimeTypeDeclarationSQL(array $fieldDeclaration)
{ {
return 'DATETIME'; return 'TIME(0)';
} }
/** /**
...@@ -1382,7 +1392,7 @@ SQL ...@@ -1382,7 +1392,7 @@ SQL
*/ */
public function supportsLimitOffset() public function supportsLimitOffset()
{ {
return false; return true;
} }
/** /**
...@@ -1426,7 +1436,7 @@ SQL ...@@ -1426,7 +1436,7 @@ SQL
*/ */
public function getDateTimeFormatString() public function getDateTimeFormatString()
{ {
return 'Y-m-d H:i:s.000'; return 'Y-m-d H:i:s.u';
} }
/** /**
...@@ -1434,7 +1444,7 @@ SQL ...@@ -1434,7 +1444,7 @@ SQL
*/ */
public function getDateFormatString() public function getDateFormatString()
{ {
return 'Y-m-d H:i:s.000'; return 'Y-m-d';
} }
/** /**
...@@ -1442,7 +1452,7 @@ SQL ...@@ -1442,7 +1452,7 @@ SQL
*/ */
public function getTimeFormatString() public function getTimeFormatString()
{ {
return 'Y-m-d H:i:s.000'; return 'H:i:s';
} }
/** /**
...@@ -1450,7 +1460,7 @@ SQL ...@@ -1450,7 +1460,7 @@ SQL
*/ */
public function getDateTimeTzFormatString() public function getDateTimeTzFormatString()
{ {
return $this->getDateTimeFormatString(); return 'Y-m-d H:i:s.u P';
} }
/** /**
...@@ -1492,6 +1502,10 @@ SQL ...@@ -1492,6 +1502,10 @@ SQL
'varbinary' => 'binary', 'varbinary' => 'binary',
'image' => 'blob', 'image' => 'blob',
'uniqueidentifier' => 'guid', 'uniqueidentifier' => 'guid',
'datetime2' => 'datetime',
'date' => 'date',
'time' => 'time',
'datetimeoffset' => 'datetimetz',
]; ];
} }
...@@ -1622,6 +1636,14 @@ SQL ...@@ -1622,6 +1636,14 @@ SQL
return $name . ' ' . $columnDef; return $name . ' ' . $columnDef;
} }
/**
* {@inheritdoc}
*/
protected function getLikeWildcardCharacters() : string
{
return parent::getLikeWildcardCharacters() . '[]^';
}
/** /**
* Returns a unique default constraint name for a table and column. * Returns a unique default constraint name for a table and column.
* *
......
...@@ -17,8 +17,6 @@ use Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords; ...@@ -17,8 +17,6 @@ use Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords; use Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords;
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\SQLServer2005Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords; use Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords;
use Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords; use Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords;
use InvalidArgumentException; use InvalidArgumentException;
...@@ -38,8 +36,6 @@ class ReservedWordsCommand extends Command ...@@ -38,8 +36,6 @@ class ReservedWordsCommand extends Command
'mysql57' => MySQL57Keywords::class, 'mysql57' => MySQL57Keywords::class,
'mysql80' => MySQL80Keywords::class, 'mysql80' => MySQL80Keywords::class,
'sqlserver' => SQLServerKeywords::class, 'sqlserver' => SQLServerKeywords::class,
'sqlserver2005' => SQLServer2005Keywords::class,
'sqlserver2008' => SQLServer2008Keywords::class,
'sqlserver2012' => SQLServer2012Keywords::class, 'sqlserver2012' => SQLServer2012Keywords::class,
'sqlite' => SQLiteKeywords::class, 'sqlite' => SQLiteKeywords::class,
'pgsql' => PostgreSQLKeywords::class, 'pgsql' => PostgreSQLKeywords::class,
...@@ -106,8 +102,6 @@ The following keyword lists are currently shipped with Doctrine: ...@@ -106,8 +102,6 @@ The following keyword lists are currently shipped with Doctrine:
* sqlite * sqlite
* oracle * oracle
* sqlserver * sqlserver
* sqlserver2005
* sqlserver2008
* sqlserver2012 * sqlserver2012
* sqlanywhere * sqlanywhere
* sqlanywhere11 * sqlanywhere11
......
...@@ -6,8 +6,6 @@ use Doctrine\DBAL\Connection; ...@@ -6,8 +6,6 @@ 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\SQLServer2005Platform;
use Doctrine\DBAL\Platforms\SQLServer2008Platform;
use Doctrine\DBAL\Platforms\SQLServer2012Platform; use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Platforms\SQLServerPlatform; use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
...@@ -22,7 +20,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -22,7 +20,7 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
protected function createPlatform() : AbstractPlatform protected function createPlatform() : AbstractPlatform
{ {
return new SQLServer2008Platform(); return new SQLServerPlatform();
} }
protected function createSchemaManager(Connection $connection) : AbstractSchemaManager protected function createSchemaManager(Connection $connection) : AbstractSchemaManager
...@@ -36,27 +34,19 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest ...@@ -36,27 +34,19 @@ class AbstractSQLServerDriverTest extends AbstractDriverTest
protected function getDatabasePlatformsForVersions() : array protected function getDatabasePlatformsForVersions() : array
{ {
return [ return [
['9', SQLServerPlatform::class], ['10', SQLServerPlatform::class],
['9.00', SQLServerPlatform::class], ['10.00', SQLServerPlatform::class],
['9.00.0', SQLServerPlatform::class], ['10.00.0', SQLServerPlatform::class],
['9.00.1398', SQLServerPlatform::class], ['10.00.1599', SQLServerPlatform::class],
['9.00.1398.99', SQLServerPlatform::class], ['10.00.1599.99', SQLServerPlatform::class],
['9.00.1399', SQLServer2005Platform::class], ['10.00.1600', SQLServerPlatform::class],
['9.00.1399.0', SQLServer2005Platform::class], ['10.00.1600.0', SQLServerPlatform::class],
['9.00.1399.99', SQLServer2005Platform::class], ['10.00.1600.99', SQLServerPlatform::class],
['9.00.1400', SQLServer2005Platform::class], ['10.00.1601', SQLServerPlatform::class],
['9.10', SQLServer2005Platform::class], ['10.10', SQLServerPlatform::class],
['9.10.9999', SQLServer2005Platform::class], ['10.10.9999', SQLServerPlatform::class],
['10.00.1599', SQLServer2005Platform::class], ['11.00.2099', SQLServerPlatform::class],
['10.00.1599.99', SQLServer2005Platform::class], ['11.00.2099.99', SQLServerPlatform::class],
['10.00.1600', SQLServer2008Platform::class],
['10.00.1600.0', SQLServer2008Platform::class],
['10.00.1600.99', SQLServer2008Platform::class],
['10.00.1601', SQLServer2008Platform::class],
['10.10', SQLServer2008Platform::class],
['10.10.9999', SQLServer2008Platform::class],
['11.00.2099', SQLServer2008Platform::class],
['11.00.2099.99', SQLServer2008Platform::class],
['11.00.2100', SQLServer2012Platform::class], ['11.00.2100', SQLServer2012Platform::class],
['11.00.2100.0', SQLServer2012Platform::class], ['11.00.2100.0', SQLServer2012Platform::class],
['11.00.2100.99', SQLServer2012Platform::class], ['11.00.2100.99', SQLServer2012Platform::class],
......
<?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([]));
}
}
...@@ -75,4 +75,9 @@ class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase ...@@ -75,4 +75,9 @@ class SQLServerPlatformTest extends AbstractSQLServerPlatformTestCase
], ],
]; ];
} }
public function testGeneratesTypeDeclarationForDateTimeTz() : void
{
self::assertEquals('DATETIMEOFFSET(6)', $this->platform->getDateTimeTzTypeDeclarationSQL([]));
}
} }
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