Skip to content

Commit

Permalink
Merge pull request #3211 from morozov/issues/3167
Browse files Browse the repository at this point in the history
Removed support for DB-generated UUIDs
  • Loading branch information
morozov committed Aug 7, 2018
2 parents 5465c6c + b269bc5 commit 89fbe15
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 130 deletions.
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Upgrade to 3.0

## BC BREAK: Removed support for DB-generated UUIDs

The support for DB-generated UUIDs was removed as non-portable.
Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://packagist.org/packages/ramsey/uuid)).

## BC BREAK: Removed MsSQLKeywords class

The `Doctrine\DBAL\Platforms\MsSQLKeywords` has been removed.
Expand Down
14 changes: 0 additions & 14 deletions lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,20 +649,6 @@ public function getRegexpExpression()
throw DBALException::notSupported(__METHOD__);
}

/**
* Returns the global unique identifier expression.
*
* @return string
*
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
throw DBALException::notSupported(__METHOD__);
}

/**
* Returns the SQL snippet to get the average value of a column.
*
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@ public function getRegexpExpression()
return 'RLIKE';
}

/**
* {@inheritDoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
return 'UUID()';
}

/**
* {@inheritDoc}
*/
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/DBAL/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ public function getLocateExpression($str, $substr, $startPos = false)
return 'INSTR('.$str.', '.$substr.', '.$startPos.')';
}

/**
* {@inheritDoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
return 'SYS_GUID()';
}

/**
* {@inheritdoc}
*/
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -1002,16 +1002,6 @@ public function getTimeTypeDeclarationSQL(array $fieldDeclaration)
return 'TIME(0) WITHOUT TIME ZONE';
}

/**
* {@inheritDoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
return 'UUID_GENERATE_V4()';
}

/**
* {@inheritDoc}
*/
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,16 +673,6 @@ public function getForUpdateSQL()
return '';
}

/**
* {@inheritdoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
return 'NEWID()';
}

/**
* {@inheritdoc}
*/
Expand Down
10 changes: 0 additions & 10 deletions lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,16 +994,6 @@ public function getDropViewSQL($name)
return 'DROP VIEW ' . $name;
}

/**
* {@inheritDoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
return 'NEWID()';
}

/**
* {@inheritDoc}
*/
Expand Down
13 changes: 0 additions & 13 deletions lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,6 @@ public function getRegexpExpression()
return 'REGEXP';
}

/**
* {@inheritDoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public function getGuidExpression()
{
return "HEX(RANDOMBLOB(4)) || '-' || HEX(RANDOMBLOB(2)) || '-4' || "
. "SUBSTR(HEX(RANDOMBLOB(2)), 2) || '-' || "
. "SUBSTR('89AB', 1 + (ABS(RANDOM()) % 4), 1) || "
. "SUBSTR(HEX(RANDOMBLOB(2)), 2) || '-' || HEX(RANDOMBLOB(6))";
}

/**
* {@inheritDoc}
*/
Expand Down
52 changes: 0 additions & 52 deletions tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL421Test.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ public function testGeneratesSQLSnippets()
self::assertEquals("Y-m-d H:i:s.u", $this->_platform->getDateTimeFormatString());
self::assertEquals("H:i:s.u", $this->_platform->getTimeFormatString());
self::assertEquals('', $this->_platform->getForUpdateSQL());
self::assertEquals('NEWID()', $this->_platform->getGuidExpression());
self::assertEquals('LOCATE(string_column, substring_column)', $this->_platform->getLocateExpression('string_column', 'substring_column'));
self::assertEquals('LOCATE(string_column, substring_column, 1)', $this->_platform->getLocateExpression('string_column', 'substring_column', 1));
self::assertEquals("HASH(column, 'MD5')", $this->_platform->getMd5Expression('column'));
Expand Down

0 comments on commit 89fbe15

Please sign in to comment.