I generated a bad migration and the file looked like this
class AddActivexToMat < ActiveRecord::Migration
def change
add_column :mats, :is_active, :boolean
add_column :mats, :default, :true
end
end
Without checking the migration file, I ran rake db:migrate and now my schema reads
# Could not dump table "mats" because of following NoMethodError
#undefined method `[]' for nil:NilClass
I tried to remove columns but getting the following errors
StandardError: An error has occurred, this and all later migrations canceled:
undefined method to_sym' for nil:NilClass/Users/jhorsch/.rvm/gems/ruby-2.0.0-p247@global/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/schema_definitions.rb:215:in
column'
I don't think changing the columns will work either and I am afraid to drop the table. I don't think I can just drop a table and add a new one with the same table name. In this case the table name was 'Mats'
Luckily this table only had one previous column 'name'
Any ideas how to fix this?
Aucun commentaire:
Enregistrer un commentaire