Migrates only foreign keys that exists in the database

[Fixes #5]