Permalink
Browse files

only dump schema information if migration table exists. Closes #14217

Conflicts:

	activerecord/CHANGELOG.md
  • Loading branch information...
1 parent 7549dba commit 18176f3c070a240e80a63bdf802cabeb13504baa @senny senny committed Mar 20, 2014
Showing with 9 additions and 1 deletion.
  1. +7 −0 activerecord/CHANGELOG.md
  2. +2 −1 activerecord/lib/active_record/railties/databases.rake
@@ -1,3 +1,10 @@
+* `rake db:structure:dump` only dumps schema information if the schema
+ migration table exists.
+
+ Fixes #14217.
+
+ *Yves Senn*
+
* Fix counter cache when association uses a class_name.
Fixes #14369.
@@ -287,7 +287,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
end

0 comments on commit 18176f3

Please sign in to comment.