Fixed bug in foreign-key handling in MigrationCredential