fix foreign key constraints