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

Ticket #875: rakefile_postgresql_port_fix_v2.diff

File rakefile_postgresql_port_fix_v2.diff, 1.6 kB (added by madrobby, 4 years ago)

Correct version of patch

  • railties/fresh_rakefile

    old new  
    121121      end 
    122122    when "postgresql" 
    123123      ENV['PGHOST']     = abcs["test"]["host"] if abcs["test"]["host"] 
     124      ENV['PGPORT']     = abcs["test"]["port"].to_s if abcs["test"]["port"] 
    124125      ENV['PGPASSWORD'] = abcs["test"]["password"] 
    125126      `psql -U "#{abcs["test"]["username"]}" -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}` 
    126127    when "sqlite", "sqlite3" 
     
    139140      File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump } 
    140141    when "postgresql" 
    141142      ENV['PGHOST']     = abcs[RAILS_ENV]["host"] if abcs[RAILS_ENV]["host"] 
     143      ENV['PGPORT']     = abcs[RAILS_ENV]["port"].to_s if abcs[RAILS_ENV]["port"] 
    142144      ENV['PGPASSWORD'] = abcs[RAILS_ENV]["password"] 
    143145      `pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}` 
    144146    when "sqlite", "sqlite3" 
     
    157159      ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"]) 
    158160    when "postgresql" 
    159161      ENV['PGHOST']     = abcs["test"]["host"] if abcs["test"]["host"] 
     162      ENV['PGPORT']     = abcs["test"]["port"].to_s if abcs["test"]["port"] 
    160163      ENV['PGPASSWORD'] = abcs["test"]["password"] 
    161164      `dropdb -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}` 
    162165      `createdb -T template0 -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`