Open caius opened 1 year ago
@ilyakatz is there any appetite for accepting this patch upstream please?
Hi @caius i'm not actively involved in this anymore. I see that @ngan assigned himself to this request though, thanks, Ngan!
Hey @caius -- we're in the middle of refactoring how migrations are run and will look to incorporate this after the dust settles.
We ran into an issue where having the following run in the same
rake db:migrate:with_data
process caused an issue:We ended up needing to call
ActiveRecord::Base#reset_column_information)
as documented in the rails guides between amending the table and trying to write to it in the same ruby process. (If you split any of the above migration files into different runs, this issue goes away.)Rather than have to remember to call reset_column_information every time we either amend a table or try to write to a table in either schema or data migrations respectively, lets just call it for all models before we run either migration. It's a very low cost call from testing and migrations aren't usually run all that often (certainly compared to web requests).