【发布时间】:2017-12-17 11:36:15
【问题描述】:
我有一个如下所示的 create_table 迁移:
class CreateOrders < ActiveRecord::Migration[5.1]
def change
create_table :orders do |t|
t.string :state
t.string :coin_sku
t.monetize :amount, currency: { present: false }
t.json :payment
t.timestamps
end
end
end
现在,当我运行 rails db:migrate 时,它会返回一条错误消息:
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
undefined method `json' for #<ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition:0x007f819fbb81b8>
Did you mean? JSON
以前有人遇到过这个问题吗?非常感谢!!
【问题讨论】:
-
SQLite 是否支持 JSON 列?这可能是您需要在该数据库上使用
text的东西。
标签: ruby-on-rails json ruby sqlite activerecord