Skip to content

Commit

Permalink
only dump schema information if migration table exists. Closes #14217
Browse files Browse the repository at this point in the history
Conflicts:

	activerecord/CHANGELOG.md
  • Loading branch information
senny committed Mar 20, 2014
1 parent 7549dba commit 18176f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions 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*

* Fix counter cache when association uses a class_name.

Fixes #14369.
Expand Down
3 changes: 2 additions & 1 deletion activerecord/lib/active_record/railties/databases.rake
Expand Up @@ -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
Expand Down

0 comments on commit 18176f3

Please sign in to comment.