Fixed foreign key generation in migration