根据 https://postgres.heroku.com/blog/past/2012/4/26/heroku_postgres_development_plan/我做了“heroku addons:add heroku-postgresql:dev”。但是当我这样做的时候
class CreateUsers < ActiveRecord::Migration
def up
create_table :users do |t|
execute "CREATE EXTENSION hstore"
t.hstore :access
end
end
def down
drop_table :users
execute "DROP EXTENSION hstore"
end
end
end
然后“heroku run rake db:migrate”我得到这个错误:
PG::错误:错误:“EXTENSION”处或附近的语法错误 第 1 行:创建扩展 hstore ^ : 创建扩展 hstore
最佳答案
终于搞定了。结果我需要使用 heroku pg:promote as per https://devcenter.heroku.com/articles/heroku-postgres-dev-plan 来“提升”数据库
关于ruby-on-rails-3 - 如何在 Heroku 上使用 hstore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11202988/