I currently have a few migrations which were created when I initially created models using rails generate model. I've run those migrations and successfully updated the database.
I've then made some changes to these migrations (not added new ones) because they were very small changes like a new column, or making a column unique, or adding an index.
But, even when I reset my db and run all migrations again, rails is insisting on using an outdated schema.rb file.
What should I be doing? How do I force a reload of this schema.rb?
Provided you haven't pushed the code to production you can run rake db:rollback
then rake db:migrate
to drop and recreate the tables.
Use this:
rake db:drop db:create db:migrate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With