Fixing relationships to allow migrations to run in a rails environment