aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railties
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-03-20 10:30:30 +0100
committerYves Senn <yves.senn@gmail.com>2014-03-20 11:12:06 +0100
commiteafec4694c5b37eff9d83b1188b8e331fa6027fa (patch)
tree9c6bc0ab72a96585da987395327df0837b005224 /activerecord/lib/active_record/railties
parent7f7a40f4d2c42a806bd6c5c40df3bdd385928181 (diff)
downloadrails-eafec4694c5b37eff9d83b1188b8e331fa6027fa.tar.gz
rails-eafec4694c5b37eff9d83b1188b8e331fa6027fa.tar.bz2
rails-eafec4694c5b37eff9d83b1188b8e331fa6027fa.zip
only dump schema information if migration table exists. Closes #14217
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r--activerecord/lib/active_record/railties/databases.rake3
1 files changed, 2 insertions, 1 deletions
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"