Ruby on rails 尝试添加Hstore迁移会在架构中出现“StandardError”
我正在尝试将Hstore Details列添加到我的products表中,如下所示:Ruby on rails 尝试添加Hstore迁移会在架构中出现“StandardError”,ruby-on-rails,activerecord,ruby-on-rails-5,Ruby On Rails,Activerecord,Ruby On Rails 5,我正在尝试将Hstore Details列添加到我的products表中,如下所示: # 20180202133309_add_hstore_extension.rb class AddHstoreExtension < ActiveRecord::Migration[5.1] def self.up enable_extension "hstore" end def self.down disable_extension "hstore" end end
# 20180202133309_add_hstore_extension.rb
class AddHstoreExtension < ActiveRecord::Migration[5.1]
def self.up
enable_extension "hstore"
end
def self.down
disable_extension "hstore"
end
end
不过,该表在我的应用程序中仍然可以正常工作,所以这是一个我可以忽略的错误吗?我不喜欢无法查看模式中的表
或者,为了节省时间,请尝试从终端:
rake db:schema:dump
那没用,谢谢你的链接!我将不得不对我当前的测试平台进行一些整合,并创建一些种子,这样我就可以转储整个数据库并从头开始尝试。我还要注意,只有Products表抛出了这个错误;其他人都不是。
# schema.rb
# Could not dump table "products" because of following StandardError
# Unknown type 'hstore' for column 'details'
rake db:schema:dump