Rails 3 and Git: two applications, a shared database

I have two Rails 3 applications that will share parts of the same database using a gem built into the system. This is an internal project in which we will always have full control over both applications. One application is open-metal administration (downside, potentially unstable) and the other is content publishing system (user collides, produces). Its impractical and not desirable to mix applications.

I've already seen Rails - Shared database tables between two applications

My suggested solution is to submodule git and share the / db directory of both applications.

I want to know if this is a valid approach, and if so, are there any pitfalls I'm tuning in for? If this is not acceptable, what is a good alternative? (The goal here is to remain as simple as possible, without interprocessor APIs.)

+3


source to share


1 answer


I have used this approach and it works. If you are using capistrano for deployment include a submodule like this

set :git_enable_submodules, 1

      



You must be careful not to forget to sync the folder /db

before you start creating migrations, they are time stamped and you might end up with the wrong sequence of migrations.

+1


source







All Articles