From eafec4694c5b37eff9d83b1188b8e331fa6027fa Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 20 Mar 2014 10:30:30 +0100 Subject: only dump schema information if migration table exists. Closes #14217 --- activerecord/CHANGELOG.md | 7 +++++++ activerecord/lib/active_record/railties/databases.rake | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index f5b8a3145d..3aee68e3c9 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,10 @@ +* `rake db:structure:dump` only dumps schema information if the schema + migration table exists. + + Fixes #14217. + + *Yves Senn* + * Reap connections that were checked out by now-dead threads, instead of waiting until they disconnect by themselves. Before this change, a suitably constructed series of short-lived threads could starve diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 1d5c80bc01..ff1f0f5911 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -268,7 +268,8 @@ db_namespace = namespace :db do current_config = ActiveRecord::Tasks::DatabaseTasks.current_config ActiveRecord::Tasks::DatabaseTasks.structure_dump(current_config, filename) - if ActiveRecord::Base.connection.supports_migrations? + if ActiveRecord::Base.connection.supports_migrations? && + ActiveRecord::SchemaMigration.table_exists? File.open(filename, "a") do |f| f.puts ActiveRecord::Base.connection.dump_schema_information f.print "\n" -- cgit v1.2.3