Successful heroku run rake db:migrate but columns don't seem to work
database, heroku, migrate, rake, ruby-on-rails
Solution
heroku restart
Check the heroku's docs: https://devcenter.heroku.com/articles/rake
After running a migration you’ll want to restart your app with heroku restart to reload the schema and pickup any schema changes.
Problem
I added a new column called level to my table called ClassRequest, ran a rake db:migrate on localhost and the view worked perfectly. Pushed the changes to heroku and the view met an error "NoMethodError: undefined method `level' for #" So I ran heroku run rake db:migrate and that appears to be successful, showing the codes below. ``` Running rake db:migrate attached to terminal... up, run.1 == AddDetailsToClassRequests: migrating ====================================== -- add_column(:class_requests, :level, :string) -> 0.0684s == AddDetailsToClassRequests: migrated (0.0713s) ============================= ``` But when I load the associated view, I still have this error "NoMethodError: undefined method `level' for #". I'm new to rails so I don't know what's wrong, nor how do I know how to check what may have gone wrong.