Skip to content

Commit

Permalink
Removed support for DB-generated UUIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Feb 6, 2019
1 parent 50da24d commit 5a949e1
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 134 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 @@ -622,20 +622,6 @@ public function getRegexpExpression()
throw DBALException::notSupported(__METHOD__);
}

/**
* Returns the global unique identifier expression.
*
* @deprecated Use application-generated UUIDs instead
*
* @return string
*
* @throws DBALException If not supported on this platform.
*/
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 @@ -78,16 +78,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 @@ -84,16 +84,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 @@ -1021,16 +1021,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 @@ -664,16 +664,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 @@ -1008,16 +1008,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 @@ -40,19 +40,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
56 changes: 0 additions & 56 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 @@ -635,7 +635,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 5a949e1

Please sign in to comment.