I'm trying to rename a column that is definitely there in the schema and all the info is there, but when I go to update it it's giving me a "missing column" error and I can't figure out why? Any ideas?
Migration:
class ChangeColumnName < ActiveRecord::Migration
def change
rename_column :postcodes, :type, :zip_type
end
end
schema.rb
create_table "postcodes", force: true do |t|
t.string "postalcode"
t.string "type"
t.string "primary_city"
t.string "state"
t.string "county"
t.string "timezone"
t.string "area_code"
t.string "latitude"
t.string "longitude"
t.string "estimated_population"
t.datetime "created_at"
t.datetime "updated_at"
end
Error:
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
== 20150304172437 ChangeColumnName: migrating =================================
-- rename_column(:postcodes, :type, :zip_type)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Missing column postcodes.typeC:/Users/Steve Q/Documents/GitHub/project1/db/migrate/20150304172437_change_column_name.rb:3:in `change'C:in `migrate' ActiveRecord::ActiveRecordError: Missing column postcodes.type