【发布时间】:2015-06-06 06:19:34
【问题描述】:
psql --version
psql (PostgreSQL) 9.4.1
rails -v
Rails 4.2.0
我通过这样的迁移添加了一个 jsonb 列
class AddPreferencesToUsers < ActiveRecord::Migration
def change
add_column :users, :preferences, :jsonb, null: false, default: '{}'
add_index :users, :preferences, using: :gin
end
end
我收到此错误:
PG::UndefinedObject: ERROR: type "jsonb" does not exist
LINE 1: SELECT 'jsonb'::regtype::oid
有什么帮助吗?
【问题讨论】:
-
我前几天也看到了这个问题,似乎没有任何解决方案。你能尝试升级到 4.2.1 还是降级你的 rails
-
@argentum47 我认为这是我的错,我会修复它并发布答案。谢谢。
标签: ruby-on-rails postgresql jsonb