Changeset 1051
- Timestamp:
- 04/02/05 01:07:33 (3 years ago)
- Files:
-
- tools/conductor/Rakefile (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/conductor/Rakefile
r1027 r1051 113 113 task :clone_structure_to_test => [ :db_structure_dump, :purge_test_database ] do 114 114 abcs = ActiveRecord::Base.configurations 115 case abcs["test"]["adapter"] 116 when "mysql" 115 if abcs["test"] 116 case abcs["test"]["adapter"] 117 when "mysql" 117 118 ActiveRecord::Base.establish_connection(:test) 118 119 ActiveRecord::Base.connection.execute('SET foreign_key_checks = 0') … … 120 121 ActiveRecord::Base.connection.execute(table) 121 122 end 122 when "postgresql"123 when "postgresql" 123 124 `psql -U #{abcs["test"]["username"]} -h #{abcs["test"]["host"]} -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}` 124 125 when "sqlite", "sqlite3" … … 126 127 else 127 128 raise "Unknown database adapter '#{abcs["test"]["adapter"]}'" 129 end 128 130 end 129 131 end … … 148 150 task :purge_test_database => :environment do 149 151 abcs = ActiveRecord::Base.configurations 150 case abcs["test"]["adapter"] 152 if abcs["test"] 153 case abcs["test"]["adapter"] 151 154 when "mysql" 152 155 ActiveRecord::Base.establish_connection(abcs[RAILS_ENV]) … … 159 162 else 160 163 raise "Unknown database adapter '#{abcs["test"]["adapter"]}'" 164 end 161 165 end 162 166 end