5

Having googled it (and looked on the heroku site) - i just can't find a set for instructions for setting a new rails app's database connection to be to a basic db created for a different (earlier) app. I know there's something to do with swapping the "color" of the databases available - but i have no idea how... and links or any simple instructions massively appreciated.

ps - i gave seen this question, but it is a couple of years old, and it seems things have moved on at heroku since then.

Community
  • 1
  • 1
user1051849
  • 2,307
  • 5
  • 26
  • 43

2 Answers2

4

Go into the directory you are pushing to Heroku and type the following:

heroku config:set DATABASE_URL=`heroku config:get DATABASE_URL -a other-app`

Where "other-app" is the database from the app you created earlier. For example:

heroku config:set DATABASE_URL=`heroku config:get DATABASE_URL -a running-tree-4822`

More detailed instructions are on Heroku's web site:

https://devcenter.heroku.com/articles/heroku-postgresql#sharing-heroku-postgres-between-applications

grrrrrr
  • 1,395
  • 12
  • 29
Jimmy Johnson
  • 889
  • 7
  • 20
0

I think the answer to the question you reference is still relevant. There's also a blog post with more details here.

Community
  • 1
  • 1
friism
  • 19,068
  • 5
  • 80
  • 116