Answer the question
In order to leave comments, you need to log in
Why does schema-tool:update try to replace existing foreign keys with its own?
I have a FK in the DB with On Update = CASCADE, On Remove = CASCADE and the names given to them. Entities and annotations were generated using the same utility (doctrine-module orm:). When updating the database structure with a utility, the doctrine wants to replace my FKs with its own (changing the name and removing the cascade of update and delete operations).
ALTER TABLE patient DROP FOREIGN KEY fk_patient_category1;
ALTER TABLE patient DROP FOREIGN KEY fk_patient_medcard1;
ALTER TABLE patient CHANGE medcard_id medcard_id INT DEFAULT NULL;
ALTER TABLE patient ADD CONSTRAINT FK_1ADAD7EB12469DE2 FOREIGN KEY (category_id) REFERENCES category (id);
ALTER TABLE patient ADD CONSTRAINT FK_1ADAD7EB5266C842 FOREIGN KEY (medcard_id) REFERENCES medcard (id);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question