【发布时间】:2014-10-12 17:02:04
【问题描述】:
我们有一些实用程序 rake 任务,用于将 postgres 数据库从 Heroku 克隆到本地开发机器,以便使用“真实”数据进行测试。他们倾向于使用 pg_restore 的 shell 命令运行导入,例如
sh 'pg_restore --verbose --clean --create --no-owner -h localhost <dbname> <filename>'
这种 postgres 操作是否可以通过 pg gem(Rails 已经到位)来实现,或者我们这里的 punt-to-shell 操作真的是最好的方法吗?我在the documentation 中没有发现任何有希望的东西。
【问题讨论】:
标签: ruby postgresql heroku rake