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

标签 ruby-on-rails-3 postgresql heroku hstore

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

相关文章:

postgresql - 如何删除 PostgreSQL 数据库中的所有表?

ruby-on-rails - 如何仅向 singleton_class 添加验证?

html - Ruby on Rails Helper 方法 - HTML 显示为纯文本

sql - 从表中删除重复项

postgresql - 避免在 PostgreSQL 9 序列中使用单个数字

java - 赫罗库。我必须在 ProcFile 中输入什么?

ruby-on-rails - Rails 3.2 电子邮件在被 Sendgrid 处理之前被延迟了 11 分钟

ruby - 运行 Heroku 控制台无法启动

ruby - 使用 ruby​​ 2.3.3 和 rails 4.2.5.2 在 Windows 7 上的 ruby​​ on rails 项目中迁移数据库时出错

ruby-on-rails - 不显示 Rails 3 的 Kaminari