Skip to content

Commit b269bc5

Browse files
committed
Removed support for DB-generated UUIDs
1 parent 5465c6c commit b269bc5

File tree

10 files changed

+5
-130
lines changed

10 files changed

+5
-130
lines changed

UPGRADE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Upgrade to 3.0
22

3+
## BC BREAK: Removed support for DB-generated UUIDs
4+
5+
The support for DB-generated UUIDs was removed as non-portable.
6+
Please generate UUIDs on the application side (e.g. using [ramsey/uuid](https://packagist.org/packages/ramsey/uuid)).
7+
38
## BC BREAK: Removed MsSQLKeywords class
49

510
The `Doctrine\DBAL\Platforms\MsSQLKeywords` has been removed.

lib/Doctrine/DBAL/Platforms/AbstractPlatform.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -649,20 +649,6 @@ public function getRegexpExpression()
649649
throw DBALException::notSupported(__METHOD__);
650650
}
651651

652-
/**
653-
* Returns the global unique identifier expression.
654-
*
655-
* @return string
656-
*
657-
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
658-
*
659-
* @deprecated Use application-generated UUIDs instead
660-
*/
661-
public function getGuidExpression()
662-
{
663-
throw DBALException::notSupported(__METHOD__);
664-
}
665-
666652
/**
667653
* Returns the SQL snippet to get the average value of a column.
668654
*

lib/Doctrine/DBAL/Platforms/MySqlPlatform.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ public function getRegexpExpression()
8080
return 'RLIKE';
8181
}
8282

83-
/**
84-
* {@inheritDoc}
85-
*
86-
* @deprecated Use application-generated UUIDs instead
87-
*/
88-
public function getGuidExpression()
89-
{
90-
return 'UUID()';
91-
}
92-
9383
/**
9484
* {@inheritDoc}
9585
*/

lib/Doctrine/DBAL/Platforms/OraclePlatform.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,6 @@ public function getLocateExpression($str, $substr, $startPos = false)
8989
return 'INSTR('.$str.', '.$substr.', '.$startPos.')';
9090
}
9191

92-
/**
93-
* {@inheritDoc}
94-
*
95-
* @deprecated Use application-generated UUIDs instead
96-
*/
97-
public function getGuidExpression()
98-
{
99-
return 'SYS_GUID()';
100-
}
101-
10292
/**
10393
* {@inheritdoc}
10494
*/

lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,16 +1002,6 @@ public function getTimeTypeDeclarationSQL(array $fieldDeclaration)
10021002
return 'TIME(0) WITHOUT TIME ZONE';
10031003
}
10041004

1005-
/**
1006-
* {@inheritDoc}
1007-
*
1008-
* @deprecated Use application-generated UUIDs instead
1009-
*/
1010-
public function getGuidExpression()
1011-
{
1012-
return 'UUID_GENERATE_V4()';
1013-
}
1014-
10151005
/**
10161006
* {@inheritDoc}
10171007
*/

lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -673,16 +673,6 @@ public function getForUpdateSQL()
673673
return '';
674674
}
675675

676-
/**
677-
* {@inheritdoc}
678-
*
679-
* @deprecated Use application-generated UUIDs instead
680-
*/
681-
public function getGuidExpression()
682-
{
683-
return 'NEWID()';
684-
}
685-
686676
/**
687677
* {@inheritdoc}
688678
*/

lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -994,16 +994,6 @@ public function getDropViewSQL($name)
994994
return 'DROP VIEW ' . $name;
995995
}
996996

997-
/**
998-
* {@inheritDoc}
999-
*
1000-
* @deprecated Use application-generated UUIDs instead
1001-
*/
1002-
public function getGuidExpression()
1003-
{
1004-
return 'NEWID()';
1005-
}
1006-
1007997
/**
1008998
* {@inheritDoc}
1009999
*/

lib/Doctrine/DBAL/Platforms/SqlitePlatform.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,6 @@ public function getRegexpExpression()
4444
return 'REGEXP';
4545
}
4646

47-
/**
48-
* {@inheritDoc}
49-
*
50-
* @deprecated Use application-generated UUIDs instead
51-
*/
52-
public function getGuidExpression()
53-
{
54-
return "HEX(RANDOMBLOB(4)) || '-' || HEX(RANDOMBLOB(2)) || '-4' || "
55-
. "SUBSTR(HEX(RANDOMBLOB(2)), 2) || '-' || "
56-
. "SUBSTR('89AB', 1 + (ABS(RANDOM()) % 4), 1) || "
57-
. "SUBSTR(HEX(RANDOMBLOB(2)), 2) || '-' || HEX(RANDOMBLOB(6))";
58-
}
59-
6047
/**
6148
* {@inheritDoc}
6249
*/

tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL421Test.php

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ public function testGeneratesSQLSnippets()
649649
self::assertEquals("Y-m-d H:i:s.u", $this->_platform->getDateTimeFormatString());
650650
self::assertEquals("H:i:s.u", $this->_platform->getTimeFormatString());
651651
self::assertEquals('', $this->_platform->getForUpdateSQL());
652-
self::assertEquals('NEWID()', $this->_platform->getGuidExpression());
653652
self::assertEquals('LOCATE(string_column, substring_column)', $this->_platform->getLocateExpression('string_column', 'substring_column'));
654653
self::assertEquals('LOCATE(string_column, substring_column, 1)', $this->_platform->getLocateExpression('string_column', 'substring_column', 1));
655654
self::assertEquals("HASH(column, 'MD5')", $this->_platform->getMd5Expression('column'));

0 commit comments

Comments
 (0)