SchemaTool drops FK constraints and re-adds needlessly #6369

Open
opened 2026-01-22 15:31:54 +01:00 by admin · 0 comments
Owner

Originally created by @oojacoboo on GitHub (Dec 13, 2019).

Bug Report

SchemaTool drops and re-generates FK constaints needlessly.

Q A
BC Break no
Version 2.7.0

Summary

When using the orm:schema-tool:update, the --dump-sql output drops foreign keys and then adds constraints needlessly.

Current behavior

I'm assuming the issue is that the name of the FK isn't what Doctrine wants. Maybe adding an annotation property to allow to define the name of the FK is necessary.

How to reproduce

  1. Create your perfect schema in the database
  2. Add Doctrine entities with all the annotation definitions
  3. Run the SchemaTool

Expected behavior

Do nothing, the constraints are correct

Originally created by @oojacoboo on GitHub (Dec 13, 2019). ### Bug Report `SchemaTool` drops and re-generates FK constaints needlessly. | Q | A |------------ | ------ | BC Break |no | Version | 2.7.0 #### Summary When using the `orm:schema-tool:update`, the `--dump-sql` output drops foreign keys and then adds constraints needlessly. #### Current behavior I'm assuming the issue is that the name of the FK isn't what Doctrine wants. Maybe adding an annotation property to allow to define the name of the FK is necessary. #### How to reproduce 1. Create your perfect schema in the database 2. Add Doctrine entities with all the annotation definitions 3. Run the `SchemaTool` #### Expected behavior Do nothing, the constraints are correct
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6369