The join table must have only two foreign keys, otherwise use has_many :through instead of.
rails g migration CreateJoinTableCustomerProduct customer product