From 5662ea511225b34d3b533d03614c496c007215b0 Mon Sep 17 00:00:00 2001 From: "Juan M. Cuello" Date: Wed, 21 Dec 2011 17:00:25 -0300 Subject: Reset postgreSQL search path in db:test:clone_structure. This patch resets the postgres search path in the structure.sql after the structure is dumped in order to find schema_migrations table when multiples schemas are used. Fixes #945 --- activerecord/lib/active_record/railties/databases.rake | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record/railties/databases.rake') diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 199eee4359..482901f23f 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -387,6 +387,7 @@ db_namespace = namespace :db do end `pg_dump -i -s -x -O -f #{filename} #{search_path} #{abcs[Rails.env]['database']}` raise 'Error dumping database' if $?.exitstatus == 1 + File.open(filename, "a") { |f| f << "SET search_path TO #{ActiveRecord::Base.connection.schema_search_path};\n\n" } when /sqlite/ dbfile = abcs[Rails.env]['database'] `sqlite3 #{dbfile} .schema > #{filename}` -- cgit v1.2.3