I have the following migration:
class CreateFoos < ActiveRecord::Migration def change create_table :foos do |t| t.hstore :foos_properties end end end
In the hstore column, I have 2 keys :foo and :bar . Is it possible to create another migration to delete :foo ? What should it look like?
I found this:
Foo.update_all([%(foos_properties = delete("foos_properties",?)), 'foo'])
It's safe? Or should I consider a more reasonable approach?
ruby-on-rails activerecord postgresql migration ruby-on-rails-4
Christian fazzini
source share