fixes migration foreign reference

fixes #4