Bug: foreign key on parent is created twice