dbal icon indicating copy to clipboard operation
dbal copied to clipboard

Deprecate dropping columns referenced by constraints

Open morozov opened this issue 4 months ago • 0 comments

Q A
Type deprecation

Summary

Currently, it is impossible to reference a non-existing column in a constraint being added but it's possible to drop the column afterwards, which will leave the table in an invalid state.

The order of operations in the following test will have to be changed once this deprecation is promoted to exception: https://github.com/doctrine/dbal/blob/33f5589058e803f9757b50a032df0301efc4908d/tests/Schema/TableTest.php#L823-L825

The following is out of scope of this PR:

  1. Renaming the column being renamed in referencing indexes and constraints.
  2. Dropping the column being dropped from referencing indexes and dropping the eventually empty indexes.

morozov avatar Oct 20 '24 02:10 morozov