Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7054: dont_use_osql_in_db_test_purge.diff

File dont_use_osql_in_db_test_purge.diff, 1.0 kB (added by Jakob S, 3 years ago)
  • railties/lib/tasks/databases.rake

    old new  
    131131          dbfile = abcs["test"]["database"] || abcs["test"]["dbfile"] 
    132132          File.delete(dbfile) if File.exist?(dbfile) 
    133133        when "sqlserver" 
    134           dropfkscript = "#{abcs["test"]["host"]}.#{abcs["test"]["database"]}.DP1".gsub(/\\/,'-') 
    135           `osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{dropfkscript}` 
    136           `osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{RAILS_ENV}_structure.sql` 
     134          ActiveRecord::Base.clear_active_connections! 
     135          ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"]) 
    137136        when "oci", "oracle" 
    138137          ActiveRecord::Base.establish_connection(:test) 
    139138          ActiveRecord::Base.connection.structure_drop.split(";\n\n").each do |ddl|