加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Rails 4 – postgresql 9.4 jsonb不存在

发布时间:2020-12-13 16:18:09 所属栏目:百科 来源:网络整理
导读:我在我的项目中使用过rails 4和 postgresql 9.4.当我运行“rdd rdc rdm rds”时我得到了这个错误PG :: UndefinedObject:ERROR:输入“jsonb”不存在怎么解决这个错误?告诉我. 我的迁移文件: class CreateConsultingLocationDoctorSchedules ActiveRecord:
我在我的项目中使用过rails 4和 postgresql 9.4.当我运行“rdd&& rdc&& rdm&& rds”时我得到了这个错误PG :: UndefinedObject:ERROR:输入“jsonb”不存在怎么解决这个错误?告诉我.

我的迁移文件:

class CreateConsultingLocationDoctorSchedules < ActiveRecord::Migration
   def change
      create_table :consulting_location_doctor_schedules do |t|
           t.belongs_to :consulting_location_doctor
           t.datetime :schedule_date,null: false
           t.jsonb :slot_details,index: true,default: {}
           t.daterange :start_and_end_time,null: false
           t.datetime :deleted_at
           t.belongs_to :deleted_by

           t.timestamps
      end
   end
end

谢谢你的帮助!

检查您是否已连接到正在开发的Postgres实例.
rails console
ActiveRecord::Base.connection.execute("select version();").first["version"]

如果您确定运行的是9.4,那么可能是您运行了两台Postgres服务器.一个9.4,一个较旧的.

我遇到了这个问题并编辑了我的database.yml和指定的主机:’localhost’.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读