class CreateAttendees < ActiveRecord::Migration
  def self.up
    create_table :attendees do |t|
      t.references :member
      t.references :raid
      t.float :attendance
    end
    
    add_index :attendees, [:member_id, :raid_id], :unique => true
  end

  def self.down
    remove_index :attendees, :column => [:member_id, :raid_id]
    drop_table :attendees
  end
end

class CreateAttendees < ActiveRecord::Migration
  def self.up
    create_table :attendees do |t|
      t.references :member
      t.references :raid
      t.float :attendance
    end
    
    add_index :attendees, [:member_id, :raid_id], :unique => true
    add_index :attendees, :member_id
    add_index :attendees, :raid_id
  end

  def self.down
    drop_table :attendees
  end
end

Add indexes to Attendees for some important performance. That table's gonna be biiiiiig.
Add indexes to Attendees for some important performance. That table's gonna be biiiiiig.
