class CreateIgrades < ActiveRecord::Migration
  def self.up
    create_table :igrades do |t|
      t.integer :student_id
      t.integer :assignment_id
      t.integer :grade

      t.timestamps
    end   
    add_index :igrades, [:assignment_id, :student_id], :unique => true
  end

  def self.down
    remove_index :igrades, :column => [:assignment_id, :student_id]
    drop_table :igrades
  end
  
end
