Create a hstore column

suggest change

Hstore columns can be useful to store settings. They are available in PostgreSQL databases after you enabled the extension.

class CreatePages < ActiveRecord::Migration[5.0]
  def change
    create_table :pages do |t|
      enable_extension 'hstore' unless extension_enabled?('hstore')
      t.hstore :settings
      t.timestamps
    end
  end
end

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


ActiveRecord migrations:
*Create a hstore column

Table Of Contents
4ActiveRecord migrations
55CSV