Permalink
Browse files

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

Conflicts:

	activerecord/CHANGELOG.md
  • Loading branch information...
1 parent 6cef846 commit 4c997103e12a3503a63e04f5f243f957c08ef415 @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*
+
* `where.not` adds `references` for `includes` like normal `where` calls do.
Fixes #14406.
@@ -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"

0 comments on commit 4c99710

Please sign in to comment.