diff --git a/UPGRADE.md b/UPGRADE.md index 0e2a38260c3..d9d4a6fe7e3 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,18 @@ awareness about deprecated code. # Upgrade to 3.2 +## Deprecated reference from `ForeignKeyConstraint` to its local (referencing) `Table`. + +Reference from `ForeignKeyConstraint` to its local (referencing) `Table` is deprecated as well as the following methods: + +- `setLocalTable()`, +- `getLocalTable()`, +- `getLocalTableName()`. + +When a foreign key is used as part of the `Table` definition, the table should be used directly. When a foreign key is +used as part of another collection (e.g. `SchemaDiff`), the collection should store the reference to the key's +referencing table separately. + ## Deprecated redundant `AbstractPlatform` methods. The following methods implement simple SQL fragments that don't vary across supported platforms. The SQL fragments diff --git a/psalm.xml.dist b/psalm.xml.dist index 891f4075c67..23589226327 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -118,6 +118,13 @@ + + + + diff --git a/src/Schema/ForeignKeyConstraint.php b/src/Schema/ForeignKeyConstraint.php index 9761887548e..49a60ba89bb 100644 --- a/src/Schema/ForeignKeyConstraint.php +++ b/src/Schema/ForeignKeyConstraint.php @@ -105,6 +105,8 @@ private function createIdentifierMap(array $names): array * Returns the name of the referencing table * the foreign key constraint is associated with. * + * @deprecated Use the table that contains the foreign key as part of its {@link Table::$_fkConstraints} instead. + * * @return string */ public function getLocalTableName() @@ -116,6 +118,8 @@ public function getLocalTableName() * Sets the Table instance of the referencing table * the foreign key constraint is associated with. * + * @deprecated Use the table that contains the foreign key as part of its {@link Table::$_fkConstraints} instead. + * * @param Table $table Instance of the referencing table. * * @return void @@ -126,6 +130,8 @@ public function setLocalTable(Table $table) } /** + * @deprecated Use the table that contains the foreign key as part of its {@link Table::$_fkConstraints} instead. + * * @return Table */ public function getLocalTable()