Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku rake db:structure:load failure

I need to use some PostgreSQL proprietary features such as rules and triggers for table partitioning. As long as I know, these kind of features cannot be dump to schema.rb so I have changed my schema_format configuration parameter to :sql.

Now, when I try to load rake db:structure:load to load the generated structure.sql into the heroku database, it fails saying: sh: psql: not found

How can I do it?

like image 512
Carlos Avatar asked Jun 04 '13 10:06

Carlos


1 Answers

You can use pg:psql to run the script from your development machine against the database:

cd your-rails-project
heroku pg:psql -a your-app-name <db/structure.sql

Just make sure that the branch you have checked out locally is the same as the one you have deployed.

like image 187
jdleesmiller Avatar answered Nov 06 '22 22:11

jdleesmiller