Forum: Ruby on Rails SwitchTower and multiple database.yml files - how do you dea

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2b2c2a705ed12f8fb327c7b4c56456c6?d=identicon&s=25 Sean Hussey (seanhussey)
on 2006-01-24 22:32
(Received via mailing list)
Hi everyone,

What are other people doing with regards to database.yml being in
version control?  My dilema:

I set up my rails app in svn using these instructions:

http://wiki.rubyonrails.com/rails/pages/HowtoUseRa...

The part to note is where I ignore database.yml, allowing different
developers to keep their own database.yml without clobbering other
developers' files.  Sounds good.  We typically use local MySQL
databases for local development and the production server uses a
remote db server running PostGres.

I just started deploying with SwitchTower, however, so, at first
checkout, there was no database.yml.  That's ok.  I created it and all
is well.

Except when I deploy the next version.  No database.yml!  Uh oh.

So, am I doing something fundamentally wrong in not version
controlling database.yml?  Should the production server only be
concerned with the production database (remote postgres) and the local
users be concerned with dev database (local mysql)?  Should all
developers learn to play nicely with one database.yml file and set the
environments up accordingly?

I'm thinking this is the way, but it's different than how I started
based on the above URL.  What are other people doing?

Thanks!

Sean
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-01-24 22:53
(Received via mailing list)
I know others have solved this problem by using an after_update_code
hook that renames the real database.yml file:

   task :after_update_code do
     run "mv #{release_path}/config/database.yml.real #{release_path}/
config/database.yml"
   end

Then, you version control the config/database.yml.real file (or not,
depending on how paranoid you are about your production DB password).

- Jamis
2b2c2a705ed12f8fb327c7b4c56456c6?d=identicon&s=25 Sean Hussey (seanhussey)
on 2006-01-24 22:59
(Received via mailing list)
Dang.  So damn easy, I can see why I didn't think of it myself.

Thank you!

Sean
This topic is locked and can not be replied to.