I am trying to add an Hstore "Details" column to my products table, as follows:
# 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
Migration was ran on the above, and then the one below
# 20180202133435_add_hstore_to_products.rb
class AddHstoreToProducts < ActiveRecord::Migration[5.1]
def change
add_column :products, :details, :hstore
add_index :products, :details, using: :gin
end
end
I thought it might be necessary to run the enable_extension
migration before the column addition migration, but either way it gives the following error in my Schema
# schema.rb
# Could not dump table "products" because of following StandardError
# Unknown type 'hstore' for column 'details'
The table still works fine in my application though, so is this an error I can just ignore? I don't like not being able to view the table in my Schema.