Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Conflicts:

	activerecord/CHANGELOG.md
  • Loading branch information...
commit 4c997103e12a3503a63e04f5f243f957c08ef415 1 parent 6cef846
@senny senny authored
View
7 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*
+
* `where.not` adds `references` for `includes` like normal `where` calls do.
Fixes #14406.
View
3  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"
Please sign in to comment.
Something went wrong with that request. Please try again.