gpt4 book ai didi

ruby-on-rails-3 - 如何在 Heroku 上使用 hstore

转载 作者:行者123 更新时间:2023-11-29 11:41:57 25 4
gpt4 key购买 nike

根据 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com