diff options
author | Dieter Komendera <dieter@komendera.com> | 2011-12-18 20:43:36 +0100 |
---|---|---|
committer | Dieter Komendera <dieter@komendera.com> | 2011-12-18 20:43:36 +0100 |
commit | a2249eee760a84385dd5af8d9ee084123bc173e3 (patch) | |
tree | 1a4651519f3ea8fe7e53ebec12877c53d6f291aa /activerecord/lib/active_record | |
parent | aa92d3732cdc75c4b5788233cb86148c04871d0d (diff) | |
download | rails-a2249eee760a84385dd5af8d9ee084123bc173e3.tar.gz rails-a2249eee760a84385dd5af8d9ee084123bc173e3.tar.bz2 rails-a2249eee760a84385dd5af8d9ee084123bc173e3.zip |
Rename STRUCTURE to DB_STRUCTURE, update dump task description and add simple testcase.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 12ef100aa6..1dc17840fa 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -371,10 +371,10 @@ db_namespace = namespace :db do end namespace :structure do - desc 'Dump the database structure to an SQL file' + desc 'Dump the database structure to db/structure.sql. Specify an alternative file (eg. db/my_strcuture.sql) using DB_STRUCTURE=db/my_strcuture.sql' task :dump => :environment do abcs = ActiveRecord::Base.configurations - filename = ENV['STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") + filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") case abcs[Rails.env]['adapter'] when /mysql/, 'oci', 'oracle' ActiveRecord::Base.establish_connection(abcs[Rails.env]) @@ -410,7 +410,7 @@ db_namespace = namespace :db do env = ENV['RAILS_ENV'] || 'test' abcs = ActiveRecord::Base.configurations - filename = ENV['STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") + filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql") case abcs[env]['adapter'] when /mysql/ ActiveRecord::Base.establish_connection(abcs[env]) |