aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorArthur Nogueira Neves <github@arthurnn.com>2016-06-16 20:07:27 -0400
committerGitHub <noreply@github.com>2016-06-16 20:07:27 -0400
commit267489a103d4b99ca73dfa0d4b34c22c8fc6a803 (patch)
tree1dadc0a7a1a2fcdaf09110ee4817b070f15af6b0 /activerecord/lib/active_record
parent7291178265a98af7c443b0bfe6ebb34e0f157de8 (diff)
parent09a90bb6a06b1dafc9881651f585e8b40dda4227 (diff)
downloadrails-267489a103d4b99ca73dfa0d4b34c22c8fc6a803.tar.gz
rails-267489a103d4b99ca73dfa0d4b34c22c8fc6a803.tar.bz2
rails-267489a103d4b99ca73dfa0d4b34c22c8fc6a803.zip
Merge pull request #24773 from ralinc/fix-silent-fail-on-psql-command
PostgreSQL: Fix db:structure:load silent failure on SQL error
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/tasks/postgresql_database_tasks.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
index 8b4874044c..b19ab57ee4 100644
--- a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
@@ -2,6 +2,7 @@ module ActiveRecord
module Tasks # :nodoc:
class PostgreSQLDatabaseTasks # :nodoc:
DEFAULT_ENCODING = ENV['CHARSET'] || 'utf8'
+ ON_ERROR_STOP_1 = 'ON_ERROR_STOP=1'.freeze
delegate :connection, :establish_connection, :clear_active_connections!,
to: ActiveRecord::Base
@@ -67,7 +68,7 @@ module ActiveRecord
def structure_load(filename)
set_psql_env
- args = [ '-q', '-f', filename, configuration['database'] ]
+ args = [ '-v', ON_ERROR_STOP_1, '-q', '-f', filename, configuration['database'] ]
run_cmd('psql', args, 'loading' )
end