# Multiple apps - one database.yml?

**URL:** <https://rubytalk.org/t/multiple-apps-one-database-yml/21783>\
**Category:** ruby-talk\
**Created:** [21 October 2005 22:26 UTC](https://rubytalk.org/t/multiple-apps-one-database-yml/21783 "2005-10-21T22:26:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rick1](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@Rick1](https://rubytalk.org/u/Rick1)\
**Post date:** [21 October 2005 22:26 UTC](https://rubytalk.org/t/multiple-apps-one-database-yml/21783/1 "2005-10-21T22:26:59Z")

</div>

Is is possible to have multiple apps whose root directories are in the  
same directory that can share a single database.yml file?

---

<div class="post-metadata">

**Author:** ![Rick1](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@Rick1](https://rubytalk.org/u/Rick1)\
**Post date:** [21 October 2005 22:27 UTC](https://rubytalk.org/t/multiple-apps-one-database-yml/21783/2 "2005-10-21T22:27:00Z")

</div>

(Sorry) that should say "rails apps"

---

<div class="post-metadata">

**Author:** ![Jonathan\_Yurek](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@Jonathan\_Yurek](https://rubytalk.org/u/Jonathan_Yurek)\
**Post date:** [22 October 2005 19:44 UTC](https://rubytalk.org/t/multiple-apps-one-database-yml/21783/3 "2005-10-22T19:44:46Z")

</div>

Rick wrote:

> Is is possible to have multiple apps whose root directories are in the  
> same directory that can share a single database.yml file?

Well, there's always the symlink or hard link. No sense putting into the language/framework what's better kept in the filesystem.

-- Jon

---

<div class="post-metadata">

**Author:** ![Miles\_Keaton](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Miles\_Keaton](https://rubytalk.org/u/Miles_Keaton)\
**Post date:** [23 October 2005 02:52 UTC](https://rubytalk.org/t/multiple-apps-one-database-yml/21783/4 "2005-10-23T02:52:30Z")

</div>

Create separate directories for your separate Rails projects.

Then (assuming you're keeping your projects in Subversion) use  
Subversions "externals" as described here:  
[http://svnbook.red-bean.com/en/1.1/ch07s04.html](http://svnbook.red-bean.com/en/1.1/ch07s04.html)

cd /home/you/project2/  
svn propset svn:externals "[http://svn.yoursite.com/project1/trunk/models&quot](http://svn.yoursite.com/project1/trunk/models&quot); models  
svn propset svn:externals "[http://svn.yoursite.com/project1/trunk/config&quot](http://svn.yoursite.com/project1/trunk/config&quot); config

Now project2 will use the config and models from project1.

We're doing this in a few different projects : 3 separate Rails  
projects, all sharing the same models and database-config.

Any time you make changes to "project1", then next time you do an svn  
update on project2 it will update.

> **···**
>
> On 10/21/05, Rick \<willirl@gmail.com\> wrote:
> 
> > Is is possible to have multiple apps whose root directories are in the  
> > same directory that can share a single database.yml file?
