Skip to content

Commit

Permalink
Merge pull request #3520 from doctrine/drop-misspelling-in-foreign-ke…
Browse files Browse the repository at this point in the history
…y-constraints

Drop support for feferred misspelling in PostgreSqlPlatform::getAdvancedForeignKeyOptionsSQL()
  • Loading branch information
jwage authored and morozov committed May 23, 2019
2 parents 3ed2f25 + 62f7ad8 commit fbe5f07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 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 PostgreSqlPlatform ForeignKeyConstraint support for `feferred` misspelling removed

`PostgreSqlPlatform::getAdvancedForeignKeyOptionsSQL()` had a typo in it in 2.x. Both the option name
`feferred` and `deferred` were supported in `2.x` but the misspelling was removed in 3.x.

## BC BREAK `AbstractSchemaManager::extractDoctrineTypeFromComment()` changed, `::removeDoctrineTypeFromComment()` removed

`AbstractSchemaManager::extractDoctrineTypeFromComment()` made `protected`. It takes the comment by reference, removes the type annotation from it and returns the extracted Doctrine type.
Expand Down
4 changes: 1 addition & 3 deletions lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey
$query .= ' NOT DEFERRABLE';
}

if (($foreignKey->hasOption('feferred') && $foreignKey->getOption('feferred') !== false)
|| ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false)
) {
if ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) {
$query .= ' INITIALLY DEFERRED';
} else {
$query .= ' INITIALLY IMMEDIATE';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testGeneratesForeignKeySqlForNonStandardOptions()
'my_table',
['id'],
'my_fk',
['feferred' => true]
['deferred' => true]
);
self::assertEquals(
'CONSTRAINT my_fk FOREIGN KEY (foreign_id) REFERENCES my_table (id) NOT DEFERRABLE INITIALLY DEFERRED',
Expand Down

0 comments on commit fbe5f07

Please sign in to comment.