Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PostgreSQL: Fix db:structure:load silent failure on SQL error #24773
PostgreSQL: Fix db:structure:load silent failure on SQL error
The command line flag "-v ON_ERROR_STOP=1" should be used when invoking psql to make sure errors are not suppressed.
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @kaspth (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.
referenced this pull request
Sep 7, 2017
@ralinc - I wish this feature had shipped with a way to disable this behavior. I upgraded to Rails 5.1 and this change has broken all of my CI and Heroku automation. The CI server appears to be running
I have no easy way to disable this feature b/c an environmental flag has been embedded in this
I'm also confused by the OP's original issue and am not 100% sure why this would even be approved and merged into ActiveRecord. A command line flag like this can be added on one's own by just appending it onto their command like this:
IMHO, this was a hastily implemented and not thoroughly reviewed feature. Is it possible to roll it back? (I know I can by forking ActiveRecord ;) )
@danielricecodes I don't like the change either but have managed to work around this by creating a custom task that leverages
namespace :db do namespace :structure do desc "Disable exit-on-error behaviour when loading db structure in postgresql" task disable_errors: :environment do ActiveRecord::Tasks::DatabaseTasks.structure_load_flags = ["-v", "ON_ERROR_STOP=0"] end end end
So, for my heroku automation it is now