class CreateTeamMemberships < ActiveRecord::Migration
  def up
    create_table :team_memberships do |t|
      t.references :user, :null => false
      t.references :team, :null => false
      t.timestamps
    end
    add_index :team_memberships, :user_id
    add_index :team_memberships, :team_id
  end

  def down
    remove_index :team_memberships, :column => :team_id
    remove_index :team_memberships, :column => :user_id
    drop_table :team_memberships
  end
end