postgresql - Rails and jsonb type "jsonb" does not exist -
psql --version psql (postgresql) 9.4.1 rails -v rails 4.2.0
i added jsonb column through migration
class addpreferencestousers < activerecord::migration def change add_column :users, :preferences, :jsonb, null: false, default: '{}' add_index :users, :preferences, using: :gin end end
i error :
pg::undefinedobject: error: type "jsonb" not exist line 1: select 'jsonb'::regtype::oid
any ?
after looking around discovered postgresql version not 9.4 running right command
postgres=# show server_version; server_version ---------------- 9.1
so had upgrade postgresql 9.4.
by way followed this article upgrading found handy.
now :
postgres=# show server_version; server_version ---------------- 9.4.1
hope in same situation.
Comments
Post a Comment