I am relatively new to rails and in the process of coding an application. So far the app itself works great. Lately I wanted to migrate something like this: (Updated)
class ChangeStuffFromTools < ActiveRecord::Migration
def change
change_column :tools, :shares, :integer, :default => 0
change_column :tools, :views, :integer, :default => 0
change_column :tools, :likes, :integer, :default => 0
change_column :tools, :favorites, :integer, :default => 0
change_column :tools, :featured, :boolean, :default => false
end
end
I get this error:
$ rails g migration remove_stuff_from_tools
invoke active_record
create db/migrate/20160904090608_remove_stuff_from_tools.rb
Jonas@JONAS_PC ~/gitapps/ocubit (master)
$ rake db:migrate
== 20160904090608 RemoveStuffFromTools: migrating =============================
-- remove_column(:tools, :featured, :boolean)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
undefined method `to_sym' for nil:NilClass
c:/Users/Jonas/gitapps/ocubit/db/migrate/20160904090608_remove_stuff_from_tools.rb:3:in
change'
c:inmigrate' NoMethodError: undefined method to_sym' for nil:NilClass
c:/Users/Jonas/gitapps/ocubit/db/migrate/20160904090608_remove_stuff_from_tools.rb:3:in
change' c:in `migrate' Tasks: TOP => db:migrate (See full trace by running task with --trace)
How can I possibly fix it, I mean I somehow need access to my database to edit it :)