Class: CreateBadgings

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/badgeable_active_record/generators/templates/badging_migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/badgeable_active_record/generators/templates/badging_migration.rb', line 2

def change
  create_table :badgings do |t|
    t.boolean :seen, :default => false

    t.references :badge
    t.references :subject, :polymorphic => true

    t.timestamps
  end

  add_index :badgings, :seen
end