title: How to use multiple databases for one rails 3.1 app in Heroku?
body: <p>My Rails 3.1 application connects to 2 databases, one is the default, the other is an Amazon RDS MYSQL instance.</p>
  
  <p>The current database.yml contains two production database connections.  The models that need to pull from the second database simply use</p>
  
  <pre><code>establish_connection "production_on_amazon"
  </code></pre>
  
  <p>Unfortunately Heroku overwrites your database.yml, and only seems to inlcude one database connection.  Does anyone know how I can add or configure my second?</p>
  
  <p>Running "heroku config" I can see there are 2 DB's listed but cant seem to configure to connect to both. Perhaps somehow set my default to the SHARED_DATABASE_URL db on Heroku and set the alternate to the DATABASE_URL which points to Amazon...</p>