I\'m in the process of converting a legacy PHP application to Symfony 2. The application data is not very consistent at the moment, so I would like to avoid creating foreign
You have to set lost foreign keys to null, then you can set your contstraint. Following query gives you the ids from datasets to change:
select p.id from product p left join manufacturer m on m.id=p.manufakturer_id where m.id is null