From 3d99d33a6456fd6da234635ba55b5bf1ce726c26 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 5 Apr 2006 03:15:50 +0000 Subject: [PATCH] Fixed that rake clone_structure_to_test should quit on pgsql if the dump is unsuccesful (closes #4585) [augustz@augustz.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/CHANGELOG | 2 ++ railties/lib/tasks/databases.rake | 1 + 2 files changed, 3 insertions(+) diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 963226000d..cc567cecf9 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed that rake clone_structure_to_test should quit on pgsql if the dump is unsuccesful #4585 [augustz@augustz.com] + * Fixed that rails --version should have the return code of 0 (success) #4560 [blair@orcaware.com] * Install alias so Rails::InfoController is accessible at /rails_info. Closes #4546. [Nicholas Seckar] diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 73bde972d1..e3272b86b4 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -47,6 +47,7 @@ namespace :db do search_path = abcs[RAILS_ENV]["schema_search_path"] search_path = "--schema=#{search_path}" if search_path `pg_dump -i -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{search_path} #{abcs[RAILS_ENV]["database"]}` + raise "Error dumping database" if $?.exitstatus == 1 when "sqlite", "sqlite3" dbfile = abcs[RAILS_ENV]["database"] || abcs[RAILS_ENV]["dbfile"] `#{abcs[RAILS_ENV]["adapter"]} #{dbfile} .schema > db/#{RAILS_ENV}_structure.sql`