Heroku db:migrate error

class MapCities < ActiveRecord::Migration
  def up
    TelephoneRecord.all.each do |tel|
      phone_record = PhoneRecord.new({
        :name => tel.name,
        :phone_no => tel.phone_no,
        :address => tel.address
      })
      phone_record.city = City.find_or_create_by_name(tel.selectcity)
      phone_record.save
    end
    drop_table :telephone_records
  end
end

when i try to deploy on this state heroku db:migrate it says uninitialized constant MapCities::TelephoneRecord then i changed it to following

class MapCities < ActiveRecord::Migration
  def up
     create_table :telephone_records do |tel|
      phone_record = PhoneRecord.new({
        :name => tel.name,
        :phone_no => tel.phone_no,
        :address => tel.address
      })
      phone_record.city = City.find_or_create_by_name(tel.selectcity)
      phone_record.save
    end
    drop_table :telephone_records
  end
end

now the error is undefined method ‘name’ for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Tabledefination:0x000000043c17f8>

Try pushing your database using this:

heroku db:push

The reason it’s saying TelephoneRecord doesn’t exist is because that model is no longer in your code.

it worked everything went fine finally i was able to push to heroku destructive action was given as warning now the problem is i am not able to search records in heroku???

http://furious-earth-6304.herokuapp.com/phone_records

localhost:3000/phone_records its perfect

Searching works for me.
http://furious-earth-6304.herokuapp.com/phone_records/search?utf8=✓&city_id=1&search_by=name&search=SISTER&match=starts_with&commit=Search

done it mark actually i was typing small a when i typed capital a done how silly mistake it was but tell me is there a way to handle this case sensitiveness in forms

You’ll find a google search faster than my response.

https://www.google.com.au/search?q=rails+case+insentitive+LIKE+search