I'm trying to do a schema update using the app/console doctrine:schema:update --force
command, but Doctrine fails on the following part:
An exception occurred while executing 'DROP INDEX IDX_E98F2859A074D5D7 ON contract':
SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_E98F2859A074D5D7': needed in a foreign key constraint
This is trivial to resolve according to another SO question. The table has:
KEY `IDX_E98F2859A074D5D7` (`some_table_id`),
CONSTRAINT `FK_E98F2859A074D5D7` FOREIGN KEY (`some_table_id`) REFERENCES `some_table` (`id`)
So this can be resolved manually by dropping the matching constraint. But is there a way to do it automatically?