foreach($queriesas$query){ try{ $this->connection->executeStatement($query); }catch(Exception $e){ // there seems to be a timing issue in sql when dropping a foreign key which relates to an index.
// Sometimes the index exists no more when doctrine tries to drop it after dropping the foreign key.
if(!\str_contains($e->getMessage(), 'An exception occurred while executing \'DROP INDEX IDX_')){ throw$e; } } }