rake db:migrate will only check the schema version in the and if the database version is then it will run all "pending" migrations.It only regenerates the file if a migration is run.by hand but you would then be responsible for telling other developers that they need to go and run them.You’d also have to keep track of which changes need to be run against the production machines next time you deploy.In the case where your actual schema is at a higher version than the version reported in the it does the only safe thing, which is nothing.The rationale is that there may not be a migration file to bring it up to date, or the database operations may force recreate the table/truncate or something equally nasty.There are other edge cases of mismatched versions but I think you get the idea.
when I run rake db:reset, the rescue statement in the first line displays: Warning: not procesing table schema_migrations. I guess I am confused why this statement is rescuing this?
Editing migration files is not a great idea, especially when you’re working in teams, but I find this works fine in the first few days of development when you don’t yet have a public version of the app in production.
Once you’ve got the app in production, you should definitely not be editing migration files.
Active Record tracks which migrations have already been run so all you have to do is update your source and run file to match the structure of your database.
Migrations also allow you to describe these transformations using Ruby.