I know there are some questions to this effect already on StackOverflow, but they tend to be pretty outdated and don't adequately address how migrations are supposed to work in the following scenario, which should be fairly common:
- You have some kind of application, implemented in Rails.
- You have some kind of admin application for your data, and it is a separate application implemented in Rails.
- Both applications operate on the same database and models.
My question is: what is the best way to factor our models such that both of these applications don't have to duplicate model code?
We are concerned with the following:
- For the shared models, where should database migrations live?
- What if each individual application wishes to add additional models on top of shared models? Where do these migrations live?
- What is the best way to move existing migrations into the proposed shared migration scheme?
Thanks.