Ticket #875: rakefile_postgresql_port_fix_v2.diff
| File rakefile_postgresql_port_fix_v2.diff, 1.6 kB (added by madrobby, 4 years ago) |
|---|
-
railties/fresh_rakefile
old new 121 121 end 122 122 when "postgresql" 123 123 ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"] 124 ENV['PGPORT'] = abcs["test"]["port"].to_s if abcs["test"]["port"] 124 125 ENV['PGPASSWORD'] = abcs["test"]["password"] 125 126 `psql -U "#{abcs["test"]["username"]}" -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}` 126 127 when "sqlite", "sqlite3" … … 139 140 File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump } 140 141 when "postgresql" 141 142 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"] 142 144 ENV['PGPASSWORD'] = abcs[RAILS_ENV]["password"] 143 145 `pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}` 144 146 when "sqlite", "sqlite3" … … 157 159 ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"]) 158 160 when "postgresql" 159 161 ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"] 162 ENV['PGPORT'] = abcs["test"]["port"].to_s if abcs["test"]["port"] 160 163 ENV['PGPASSWORD'] = abcs["test"]["password"] 161 164 `dropdb -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}` 162 165 `createdb -T template0 -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`