Fix foreign key relation