diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/tasks/databases.rake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 5ea69da240..e7ae234b53 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -61,6 +61,10 @@ task :db_structure_dump => :environment do else raise "Unknown database adapter '#{abcs["test"]["adapter"]}'" end + + if ActiveRecord::Base.connection.supports_migrations? + File.open("db/#{RAILS_ENV}_structure.sql", "a") { |f| f << ActiveRecord::Base.connection.dump_schema_information } + end end desc "Empty the test database" |