I have this AchRelationship model:
class AchRelationship < ApplicationRecord
belongs_to :account
end
And an Account model:
class Account < ApplicationRecord
has_one :ach_relationship, dependent: :destroy
end
In my schema.rb file, I see this line, which makes sense to me:
add_foreign_key "ach_relationships", "accounts"
However, the issue I'm running into is that whenever I run rake db:migrate to add new migrations, that line in my schema.rb file gets deleted. It happens even when there are no new migrations. This happens with some members on my team but not all of us. With the other members, whenever they run rake db:migrate, they would add that line back if it was gone. So what ends up happening is that we keep seeing that line getting deleted and added back in our PRs and nobody was able to figure out why.
So my question is did I and some other team members do something weird when we set up our database? What can we do to fix this and prevent it from happening again? Thanks for reading!