cirandas.net

ref: master

db/migrate/20170417135607_add_jsonb_fields.rb


1
2
3
4
5
6
7
8
class AddJsonbFields < ActiveRecord::Migration
  def change
    %w[profiles articles tasks blocks users].each do |table|
      add_column table, :metadata, :jsonb, :default => {}
      add_index  table, :metadata, using: :gin
    end
  end
end