heroku rake db:结构:加载失败 [英] heroku rake db:structure:load failure
问题描述
我需要使用一些PostgreSQL专有功能,例如规则和触发器来进行表分区。只要我知道,这些功能不能转储到schema.rb,所以我已经将我的schema_format配置参数更改为:sql。
现在,当我尝试load rake db:structure:load将生成的structure.sql加载到heroku数据库中,但它失败:sh:psql:找不到
我该怎么做?
pg:psql
来运行脚本开发机器对数据库: cd your-rails-project
heroku pg:psql -a your-app-名称< db / structure.sql
只要确保您在本地签出的分支是与您部署的相同。
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?
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.
这篇关于heroku rake db:结构:加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!