Skip to content

Commit

Permalink
Move to db:structure namespace, because these methods are global.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj committed Jun 25, 2012
1 parent 09bb777 commit 04002db
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions activerecord/lib/active_record/railties/databases.rake
Expand Up @@ -270,6 +270,15 @@ db_namespace = namespace :db do
end

namespace :structure do
def set_firebird_env(config)
ENV['ISC_USER'] = config['username'].to_s if config['username']
ENV['ISC_PASSWORD'] = config['password'].to_s if config['password']
end

def firebird_db_string(config)
FireRuby::Database.db_string_for(config.symbolize_keys)
end

desc 'Dump the database structure to db/structure.sql. Specify another file with DB_STRUCTURE=db/my_structure.sql'
task :dump => [:environment, :load_config] do
abcs = ActiveRecord::Base.configurations
Expand Down Expand Up @@ -450,11 +459,3 @@ end

task 'test:prepare' => 'db:test:prepare'

def set_firebird_env(config)
ENV['ISC_USER'] = config['username'].to_s if config['username']
ENV['ISC_PASSWORD'] = config['password'].to_s if config['password']
end

def firebird_db_string(config)
FireRuby::Database.db_string_for(config.symbolize_keys)
end

0 comments on commit 04002db

Please sign in to comment.