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
有什么帮助吗?