Which is the best way to do database migration when association changes?
For example:
Add has_one/ has_many/ & belongs_to association to 2 models have no association.
Add has_many_and_belongs_to association to 2 models have no association.
Add has_one/ has_many/ & belongs_to association to 2 models that one model have association with other model, another model is newly created.
When your association changes, is it not just that you have to change the foreign keys in the db scheme and create specific migrations for that?
For example if you want to add a has_many relationship to store which has many books. You could easily create a migration with the generate command.
Then in your model/store.rb
And in the model/book.rb
Otherwise I didn’t understand your question 🙂