Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share a heroku basic postgres DB between 2 heroku apps

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.

like image 731
user1051849 Avatar asked Oct 06 '22 05:10

user1051849


1 Answers

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

like image 53
Jimmy Johnson Avatar answered Oct 19 '22 00:10

Jimmy Johnson