20160416180807_add_award_emoji.rb 386 Bytes
Newer Older
1
# rubocop:disable all
2
class AddAwardEmoji < ActiveRecord::Migration[4.2]
3 4
  DOWNTIME = false

5 6 7 8 9 10
  def change
    create_table :award_emoji do |t|
      t.string :name
      t.references :user
      t.references :awardable, polymorphic: true

11
      t.timestamps null: true
12 13 14
    end

    add_index :award_emoji, :user_id
Z.J. van de Weg's avatar
Z.J. van de Weg committed
15
    add_index :award_emoji, [:awardable_type, :awardable_id]
16 17
  end
end