Hello Wes,

Answer to your questions below:

On Tue, 2010-12-28 at 17:14 -0600, Wes Gamble wrote:
> From http://docs.heroku.com/database:
> 
> 
> "Each database installed on a Heroku app has a unique database URL
> which can be used by your app to connect to that database. The URLs
> are viewable and accessible through config vars. The config var name
> for the default shared database is SHARED_DATABASE_URL.
> 
> In addition, each app has a config var named DATABASE_URL, which is
> the database that Rails will use by default. You can change which
> database is set to DATABASE_URL with the ‘heroku pg:promote’ command."
> 
> 
> I'm confused.
> 
> 
> 1) Do both of these configuration variables always exist for a given
> app.?

Yes.
> 
> 
> 2) When would SHARED_DATABASE_URL be used as opposed to DATABASE_URL?

The SHARED_DATABASE_URL just keeps track of the shared database url. The
DATABASE_URL is what actually gets written out to config/database.yml
for your app. When you first create your heroku app these two config
vars should be the same.

When you have more than one database the value of having two config vars
becomes apparent. For instance, you might choose to use Amazon RDS where
you would change your DATABASE_URL. The SHARED_DATABASE_URL is still
around in case you decide to switch back. If you decided to purchase a
dedicated database, you'd get a HEROKU_POSTGRESQL_RONIN_URL for instance
which you would promote to your DATABASE_URL. When you decide to
downgrade you could promote your SHARED_DATABASE_URL back.

Hope that helps,
Terence


> 
> Thanks,
> Wes
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Heroku" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to heroku
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to