Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert records to Heroku database

How can I insert new records to Heroku database. I have successfully uploaded my application and database structure. Now I need to insert some records so it could work. I tried to use seeds.rb but without any success. db:push and db:seed don't give any success. The database is always empty. Is there any heroku tool available which I could use to see database structure and insert data?

Thank you.

like image 273
Cristiano Avatar asked Dec 16 '22 05:12

Cristiano


1 Answers

You have a few options. You can run heroku run rake db:seed.

Or assuming Postgres, try

heroku pg:psql

And run your SQL commands from there. See here for more.

I was also able to connect my IDE to my databases on Heroku. I am using RubyMine, so it was a matter of using the right JDBC URL to make that happen.

like image 87
Vidya Avatar answered Dec 30 '22 13:12

Vidya