Skip to content

Commit

Permalink
Dropped SQL Server 2008 support
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Mar 18, 2020
1 parent 5cdd36a commit 046ad68
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 908 deletions.
5 changes: 0 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ cache:
## Build matrix for lowest and highest possible targets
environment:
matrix:
- db: mssql
driver: sqlsrv
db_version: sql2008r2sp2
coverage: yes
php: 7.3
- db: mssql
driver: sqlsrv
db_version: sql2012sp1
Expand Down
12 changes: 8 additions & 4 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,22 @@ The following classes have been removed:
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords`

## BC BREAK: Removed support for SQL Server 2005 and older
## BC BREAK: Removed support for SQL Server 2008 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.
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.
`Doctrine\DBAL\Platforms\SQLServerPlatform` and `Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords` now represent SQL Server 2012.

The following classes have been removed:

* `Doctrine\DBAL\Platforms\SQLServer2005Platform`
* `Doctrine\DBAL\Platforms\SQLServer2008Platform`
* `Doctrine\DBAL\Platforms\SQLServer2012Platform`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords`
* `Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords`

The `AbstractSQLServerDriver` class and its subclasses no longer implement the `VersionAwarePlatformDriver` interface.

## BC BREAK: Removed support for PostgreSQL 9.2 and older

Expand Down
3 changes: 1 addition & 2 deletions docs/en/reference/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ Oracle
Microsoft SQL Server
^^^^^^^^^^^^^^^^^^^^

- ``SQLServerPlatform`` for version 2008 and above.
- ``SQLServer2012Platform`` for version 2012 and above.
- ``SQLServerPlatform`` for version 2012 and above.

PostgreSQL
^^^^^^^^^^
Expand Down
38 changes: 2 additions & 36 deletions lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,15 @@
namespace Doctrine\DBAL\Driver;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Schema\SQLServerSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver;
use function preg_match;
use function version_compare;

/**
* Abstract base implementation of the {@link Doctrine\DBAL\Driver} interface for Microsoft SQL Server based drivers.
*/
abstract class AbstractSQLServerDriver implements VersionAwarePlatformDriver
abstract class AbstractSQLServerDriver implements Driver
{
/**
* {@inheritdoc}
*/
public function createDatabasePlatformForVersion($version)
{
if (! preg_match(
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+)(?:\.(?P<build>\d+))?)?)?/',
$version,
$versionParts
)) {
throw DBALException::invalidPlatformVersionSpecified(
$version,
'<major_version>.<minor_version>.<patch_version>.<build_version>'
);
}

$majorVersion = $versionParts['major'];
$minorVersion = $versionParts['minor'] ?? 0;
$patchVersion = $versionParts['patch'] ?? 0;
$buildVersion = $versionParts['build'] ?? 0;
$version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion . '.' . $buildVersion;

switch (true) {
case version_compare($version, '11.00.2100', '>='):
return new SQLServer2012Platform();
default:
return new SQLServerPlatform();
}
}

/**
* {@inheritdoc}
*/
Expand Down
37 changes: 0 additions & 37 deletions lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php

This file was deleted.

5 changes: 5 additions & 0 deletions lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ protected function getKeywords()
'SCHEMA',
'SECURITYAUDIT',
'SELECT',
'SEMANTICKEYPHRASETABLE',
'SEMANTICSIMILARITYDETAILSTABLE',
'SEMANTICSIMILARITYTABLE',
'SESSION_USER',
'SET',
'SETUSER',
Expand All @@ -188,6 +191,7 @@ protected function getKeywords()
'TRANSACTION',
'TRIGGER',
'TRUNCATE',
'TRY_CONVERT',
'TSEQUAL',
'UNION',
'UNIQUE',
Expand All @@ -204,6 +208,7 @@ protected function getKeywords()
'WHERE',
'WHILE',
'WITH',
'WITHIN GROUP',
'WRITETEXT',
];
}
Expand Down
143 changes: 0 additions & 143 deletions lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php

This file was deleted.

Loading

0 comments on commit 046ad68

Please sign in to comment.