class CreateMentions

Public Instance Methods

change() click to toggle source
# File lib/generators/socialization/templates/active_record/migration_mentions.rb, line 2
def change
  create_table :mentions do |t|
    t.string  :mentioner_type
    t.integer :mentioner_id
    t.string  :mentionable_type
    t.integer :mentionable_id
    t.datetime :created_at
  end

  add_index :mentions, ["mentioner_id", "mentioner_type"],   :name => "fk_mentions"
  add_index :mentions, ["mentionable_id", "mentionable_type"], :name => "fk_mentionables"
end